]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Get rid of an unused global, rename another one
authorterencehill <piuntn@gmail.com>
Fri, 5 Mar 2021 17:55:40 +0000 (18:55 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 5 Mar 2021 17:55:40 +0000 (18:55 +0100)
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/damage.qc
qcsrc/server/damage.qh
qcsrc/server/weapons/accuracy.qc

index 3ece45bdee273998fd29d8cff20fdf556e33064e..aefc7234692f4e606075d2493dd785ea492dff30 100644 (file)
@@ -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);
index 57668782f1da5ce889aa31dc733e6e3b0ba077b8..6f4d4aebf282b6a9a596c9a0d51819543d10b678 100644 (file)
@@ -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);
             }
index 0e967c92ef69e73b930687c93ad4fd5e1ffab103..7372fe8e1eb4b8183d925aaa45c46055b394feb9 100644 (file)
@@ -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);
index 06dcabe7f96f4b4a44686b7474fdf5b15ac80ff6..ff234ab902323792c4150fd3ce858d3cbc160150 100644 (file)
@@ -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;
index 7284f8c19f53f1250c1792fb015fe428089b5408..ea64dcf575d15e06701bb0bf111aa3ef3f33ef1e 100644 (file)
@@ -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
 
index 3eafbc76c7025f0eae0aac9e691b087e5dd77a78..2fe010f645c0c9a2c953df6c875cf50d0351c5c2 100644 (file)
@@ -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