]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge self from FireRailgunBullet
authorMario <mario@smbclan.net>
Wed, 18 May 2016 09:38:31 +0000 (19:38 +1000)
committerMario <mario@smbclan.net>
Wed, 18 May 2016 09:38:31 +0000 (19:38 +1000)
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh

index 5b2fd0f35fc363602e0abb9d20e2437385b94401..a70e13756ce1d708ae024cf4d4a32dfa18565e45 100644 (file)
@@ -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);
index 55226bd864d47f87d92c9caa3fa819bb6b5a7cc9..6f712b370db2c101cf568ad35683ff76e83b6e94 100644 (file)
@@ -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);
 
 
index 8ce6caadd546b337e0ccd88c3ade4cfcf5400b6d..08f66389915a91dd9cb02f288b1aceaf48e6bc9a 100644 (file)
@@ -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);
index c0c434561736764acd3231140665e0152774b647..210bb14aa72fc6e8526438bb547c180ac58867bf 100644 (file)
@@ -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);
index 311edd0883586944d3bd5b28e6e61c2afe5d7d8a..81fa73d49391e99b2f35d902dca09b2eac08e069 100644 (file)
@@ -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;
index fed7364b2556f2435a0a7a8635d5b6977c61e9e5..decdc39d95a1e5637555147683eed05e5e9e46dd 100644 (file)
@@ -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;