]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/tesla_weapon.qc
Purge SELFPARAM from the turret code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / tesla_weapon.qc
index a283a738f2c79c93737698d02d86ff849c7e52c6..a2d11d53cce9a5a941b63ac0327aca5886d6ddde 100644 (file)
@@ -4,7 +4,7 @@
 
 #ifdef SVQC
 
-entity toast(entity from, float range, float damage);
+entity toast(entity actor, entity from, float range, float damage);
 SOUND(TeslaCoilTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
@@ -26,7 +26,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti
 
         actor.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK;
 
-        entity t = toast(e,r,d);
+        entity t = toast(actor, e,r,d);
         remove(e);
 
         if (t == NULL) return;
@@ -37,7 +37,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti
         for (int i = 0; i < 10; ++i) {
             d *= 0.75;
             r *= 0.85;
-            t = toast(t, r, d);
+            t = toast(actor, t, r, d);
             if (t == world) break;
 
         }
@@ -51,8 +51,8 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti
     }
 }
 
-entity toast(entity from, float range, float damage)
-{SELFPARAM();
+entity toast(entity actor, entity from, float range, float damage)
+{
     entity e;
     entity etarget = world;
     float d,dd;
@@ -65,7 +65,7 @@ entity toast(entity from, float range, float damage)
     {
         if ((e.railgunhit != 1) && (e != from))
         {
-            r = turret_validate_target(self,e,self.target_validate_flags);
+            r = turret_validate_target(actor,e,actor.target_validate_flags);
             if (r > 0)
             {
                 traceline(from.origin,0.5 * (e.absmin + e.absmax),MOVE_WORLDONLY,from);
@@ -86,7 +86,7 @@ entity toast(entity from, float range, float damage)
     if (etarget)
     {
         te_csqc_lightningarc(from.origin,etarget.origin);
-        Damage(etarget, self, self, damage, DEATH_TURRET_TESLA.m_id, etarget.origin, '0 0 0');
+        Damage(etarget, actor, actor, damage, DEATH_TURRET_TESLA.m_id, etarget.origin, '0 0 0');
         etarget.railgunhit = 1;
     }