From bf396381b13da7693c4bcca3b74848186ec1c680 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 18 May 2016 19:38:31 +1000 Subject: [PATCH] Purge self from FireRailgunBullet --- qcsrc/common/turrets/turret/plasma.qc | 2 +- qcsrc/common/turrets/turret/plasma_dual.qc | 2 +- qcsrc/common/weapons/weapon/vaporizer.qc | 2 +- qcsrc/common/weapons/weapon/vortex.qc | 2 +- qcsrc/server/weapons/tracing.qc | 26 +++++++++++----------- qcsrc/server/weapons/tracing.qh | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/qcsrc/common/turrets/turret/plasma.qc b/qcsrc/common/turrets/turret/plasma.qc index 5b2fd0f35..a70e13756 100644 --- a/qcsrc/common/turrets/turret/plasma.qc +++ b/qcsrc/common/turrets/turret/plasma.qc @@ -28,7 +28,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it)) { if(g_instagib) { - FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, + FireRailgunBullet (self, self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); diff --git a/qcsrc/common/turrets/turret/plasma_dual.qc b/qcsrc/common/turrets/turret/plasma_dual.qc index 55226bd86..6f712b370 100644 --- a/qcsrc/common/turrets/turret/plasma_dual.qc +++ b/qcsrc/common/turrets/turret/plasma_dual.qc @@ -34,7 +34,7 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it)) { SELFPARAM(); if (g_instagib) { - FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, + FireRailgunBullet (self, self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 8ce6caadd..08f663899 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -190,7 +190,7 @@ void W_Vaporizer_Attack(Weapon thiswep) yoda = 0; damage_goodhits = 0; - FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); + FireRailgunBullet(self, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); // do this now, as goodhits is disabled below SendCSQCVaporizerBeamParticle(self, damage_goodhits); diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index c0c434561..210bb14aa 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -190,7 +190,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) yoda = 0; damage_goodhits = 0; - FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); + FireRailgunBullet(self, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); if(yoda && flying) Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 311edd088..81fa73d49 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -197,8 +197,8 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p // Ballistics Tracing // ==================== -void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype) -{SELFPARAM(); +void FireRailgunBullet (entity this, vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype) +{ vector hitloc, force, endpoint, dir; entity ent, endent; float endq3surfaceflags; @@ -225,13 +225,13 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f // trace multiple times until we hit a wall, each obstacle will be made // non-solid so we can hit the next, while doing this we spawn effects and // note down which entities were hit so we can damage them later - o = self; + o = this; while (1) { - if(CS(self).antilag_debug) - WarpZone_traceline_antilag (self, start, end, false, o, CS(self).antilag_debug); + if(CS(this).antilag_debug) + WarpZone_traceline_antilag (this, start, end, false, o, CS(this).antilag_debug); else - WarpZone_traceline_antilag (self, start, end, false, o, ANTILAG_LATENCY(self)); + WarpZone_traceline_antilag (this, start, end, false, o, ANTILAG_LATENCY(this)); if(o && WarpZone_trace_firstzone) { o = world; @@ -239,7 +239,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f } if(trace_ent.solid == SOLID_BSP || trace_ent.solid == SOLID_SLIDEBOX) - Damage_DamageInfo(trace_endpos, bdamage, 0, 0, force, deathtype, trace_ent.species, self); + Damage_DamageInfo(trace_endpos, bdamage, 0, 0, force, deathtype, trace_ent.species, this); // if it is world we can't hurt it so stop now if (trace_ent == world || trace_fraction == 1) @@ -279,9 +279,9 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f // Find all non-hit players the beam passed close by if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id) { - FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != self, LAMBDA( + FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != this, LAMBDA( if(!it.railgunhit) - if(!(IS_SPEC(it) && it.enemy == self)) + if(!(IS_SPEC(it) && it.enemy == this)) { msg_entity = it; // nearest point on the beam @@ -313,16 +313,16 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f f = ExponentialFalloff(mindist, maxdist, halflifedist, ent.railgundistance); ffs = ExponentialFalloff(mindist, maxdist, forcehalflifedist, ent.railgundistance); - if(accuracy_isgooddamage(self, ent)) + if(accuracy_isgooddamage(this, ent)) totaldmg += bdamage * f; // apply the damage if (ent.takedamage) - Damage (ent, self, self, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs); + Damage (ent, this, this, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs); // create a small explosion to throw gibs around (if applicable) //setorigin (explosion, hitloc); - //RadiusDamage (explosion, self, 10, 0, 50, world, world, 300, deathtype); + //RadiusDamage (explosion, this, 10, 0, 50, world, world, 300, deathtype); ent.railgunhitloc = '0 0 0'; ent.railgunhitsolidbackup = SOLID_NOT; @@ -334,7 +334,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f } // calculate hits and fired shots for hitscan - accuracy_add(self, PS(self).m_weapon.m_id, 0, min(bdamage, totaldmg)); + accuracy_add(this, PS(this).m_weapon.m_id, 0, min(bdamage, totaldmg)); trace_endpos = endpoint; trace_ent = endent; diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index fed7364b2..decdc39d9 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -49,7 +49,7 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p .float railgundistance; .vector railgunforce; -void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype); +void FireRailgunBullet (entity this, vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype); entity fireBullet_trace_callback_eff; entity fireBullet_last_hit; -- 2.39.2