From: terencehill Date: Fri, 5 Mar 2021 17:55:40 +0000 (+0100) Subject: Get rid of an unused global, rename another one X-Git-Tag: xonotic-v0.8.5~526 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8f32d4d703daa4950de06cbea755fa5efd6503ba;p=xonotic%2Fxonotic-data.pk3dir.git Get rid of an unused global, rename another one --- diff --git a/qcsrc/common/mutators/mutator/overkill/oknex.qc b/qcsrc/common/mutators/mutator/overkill/oknex.qc index 3ece45bde..aefc72346 100644 --- a/qcsrc/common/mutators/mutator/overkill/oknex.qc +++ b/qcsrc/common/mutators/mutator/overkill/oknex.qc @@ -94,18 +94,18 @@ void W_OverkillNex_Attack(Weapon thiswep, entity actor, .entity weaponentity, fl } yoda = 0; - damage_goodhits = 0; + impressive_hits = 0; FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id); if(yoda && flying) Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); - if(damage_goodhits && actor.oknex_lasthit) + if(impressive_hits && actor.oknex_lasthit) { Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.oknex_lasthit = damage_goodhits; + actor.oknex_lasthit = impressive_hits; //beam and muzzle flash done on client SendCSQCVortexBeamParticle(charge); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 57668782f..6f4d4aebf 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -123,23 +123,23 @@ void W_Vaporizer_Attack(Weapon thiswep, entity actor, .entity weaponentity) sound (actor, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM); yoda = 0; - damage_goodhits = 0; + impressive_hits = 0; FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, true, WEP_CVAR_PRI(vaporizer, force), 0, 0, 0, 0, thiswep.m_id); // do this now, as goodhits is disabled below vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg)); - SendCSQCVaporizerBeamParticle(actor, damage_goodhits); + SendCSQCVaporizerBeamParticle(actor, impressive_hits); if(yoda && flying) Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); - if(damage_goodhits && actor.vaporizer_lasthit) + if(impressive_hits && actor.vaporizer_lasthit) { Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.vaporizer_lasthit = damage_goodhits; + actor.vaporizer_lasthit = impressive_hits; if(autocvar_g_rm) if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))) @@ -317,13 +317,13 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent actor.(weaponentity).held_down = true; actor.(weaponentity).jump_interval = time + autocvar_g_rm_laser_refire; actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_delay; - damage_goodhits = 0; + impressive_hits = 0; W_RocketMinsta_Attack2(actor, weaponentity); } else if(rapid && actor.(weaponentity).jump_interval2 <= time && actor.(weaponentity).held_down) { actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_refire; - damage_goodhits = 0; + impressive_hits = 0; W_RocketMinsta_Attack3(actor, weaponentity); //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_rm_laser_rapid_animtime, w_ready); } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 0e967c92e..7372fe8e1 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -138,18 +138,18 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i } yoda = 0; - damage_goodhits = 0; + impressive_hits = 0; FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype); if(yoda && flying) Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); - if(damage_goodhits && actor.vortex_lasthit) + if(impressive_hits && actor.vortex_lasthit) { Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); - damage_goodhits = 0; // only every second time + impressive_hits = 0; // only every second time } - actor.vortex_lasthit = damage_goodhits; + actor.vortex_lasthit = impressive_hits; //beam done on client vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index 06dcabe7f..ff234ab90 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -818,8 +818,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de attacker.damage_dealt += damage; } - damage_goodhits += 1; - damage_gooddamage += damage; + impressive_hits += 1; if (!DEATH_ISSPECIAL(deathtype)) { @@ -888,9 +887,9 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de } } +// Returns total damage applies to creatures float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity) - // Returns total damage applies to creatures { entity targ; vector force; diff --git a/qcsrc/server/damage.qh b/qcsrc/server/damage.qh index 7284f8c19..ea64dcf57 100644 --- a/qcsrc/server/damage.qh +++ b/qcsrc/server/damage.qh @@ -49,8 +49,7 @@ float checkrules_firstblood; .float damagedbytriggers; float yoda; -float damage_goodhits; -float damage_gooddamage; +int impressive_hits; .float pain_finished; // Added by Supajoe diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 3eafbc76c..2fe010f64 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -65,7 +65,7 @@ void accuracy_resend(entity e) //.float hit_time; .float fired_time; -void accuracy_add(entity this, Weapon w, int fired, int hit) +void accuracy_add(entity this, Weapon w, float fired, float hit) { if (IS_INDEPENDENT_PLAYER(this)) return; entity a = CS(this).accuracy; @@ -98,8 +98,7 @@ bool accuracy_isgooddamage(entity attacker, entity targ) { int mutator_check = MUTATOR_CALLHOOK(AccuracyTargetValid, attacker, targ); - if (warmup_stage) return false; - if (game_stopped) return false; + if (warmup_stage || game_stopped) return false; // damage to dead/frozen players is good only if it happens in the frame they get killed / frozen // so that stats for weapons that shoot multiple projectiles per shot are properly counted