]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/minelayer.qc
Fix vaporizer missing its muzzle flash if the particle beam mode is enabled
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / minelayer.qc
index f8c3c6ca93298ded90dd9b0dd331b24f8353795f..bc7f8eb39efbe6be32be3d9cb757bf355af3c402 100644 (file)
@@ -53,7 +53,7 @@ ENDCLASS(MineLayer)
 REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
 
 #ifdef SVQC
-void W_MineLayer_Think();
+void W_MineLayer_Think(entity this);
 .float minelayer_detonate, mine_explodeanyway;
 .float mine_time;
 .vector mine_orientation;
@@ -63,8 +63,8 @@ void W_MineLayer_Think();
 #ifdef SVQC
 spawnfunc(weapon_minelayer) { weapon_defaultspawnfunc(this, WEP_MINE_LAYER); }
 
-void W_MineLayer_Stick(entity to)
-{SELFPARAM();
+void W_MineLayer_Stick(entity this, entity to)
+{
        spamsound(self, CH_SHOTS, SND(MINE_STICK), VOL_BASE, ATTN_NORM);
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
@@ -108,8 +108,8 @@ void W_MineLayer_Stick(entity to)
                SetMovetypeFollow(newmine, to);
 }
 
-void W_MineLayer_Explode()
-{SELFPARAM();
+void W_MineLayer_Explode(entity this)
+{
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
@@ -138,8 +138,8 @@ void W_MineLayer_Explode()
        remove(self);
 }
 
-void W_MineLayer_DoRemoteExplode()
-{SELFPARAM();
+void W_MineLayer_DoRemoteExplode(entity this)
+{
        self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
 
@@ -164,20 +164,20 @@ void W_MineLayer_DoRemoteExplode()
        remove(self);
 }
 
-void W_MineLayer_RemoteExplode()
-{SELFPARAM();
+void W_MineLayer_RemoteExplode(entity this)
+{
        if(!IS_DEAD(self.realowner))
                if((self.spawnshieldtime >= 0)
                        ? (time >= self.spawnshieldtime) // timer
                        : (vdist(NearestPointOnBox(self.realowner, self.origin) - self.origin, >, WEP_CVAR(minelayer, remote_radius))) // safety device
                )
                {
-                       W_MineLayer_DoRemoteExplode();
+                       W_MineLayer_DoRemoteExplode(self);
                }
 }
 
-void W_MineLayer_ProximityExplode()
-{SELFPARAM();
+void W_MineLayer_ProximityExplode(entity this)
+{
        // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
        if(WEP_CVAR(minelayer, protection) && self.mine_explodeanyway == 0)
        {
@@ -192,7 +192,7 @@ void W_MineLayer_ProximityExplode()
        }
 
        self.mine_time = 0;
-       W_MineLayer_Explode();
+       W_MineLayer_Explode(self);
 }
 
 int W_MineLayer_Count(entity e)
@@ -205,8 +205,8 @@ int W_MineLayer_Count(entity e)
        return minecount;
 }
 
-void W_MineLayer_Think()
-{SELFPARAM();
+void W_MineLayer_Think(entity this)
+{
        entity head;
 
        self.nextthink = time;
@@ -236,7 +236,7 @@ void W_MineLayer_Think()
        {
                other = world;
                self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_MineLayer_Explode();
+               W_MineLayer_Explode(self);
                return;
        }
 
@@ -257,7 +257,7 @@ void W_MineLayer_Think()
        // explode if it's time to
        if(self.mine_time && time >= self.mine_time)
        {
-               W_MineLayer_ProximityExplode();
+               W_MineLayer_ProximityExplode(self);
                return;
        }
 
@@ -265,15 +265,15 @@ void W_MineLayer_Think()
        if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
        if(!IS_DEAD(self.realowner))
        if(self.minelayer_detonate)
-               W_MineLayer_RemoteExplode();
+               W_MineLayer_RemoteExplode(self);
 }
 
-void W_MineLayer_Touch()
-{SELFPARAM();
+void W_MineLayer_Touch(entity this)
+{
        if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
                return; // we're already a stuck mine, why do we get called? TODO does this even happen?
 
-       if(WarpZone_Projectile_Touch())
+       if(WarpZone_Projectile_Touch(self))
        {
                if(wasfreed(self))
                        self.realowner.minelayer_mines -= 1;
@@ -287,7 +287,7 @@ void W_MineLayer_Touch()
        }
        else
        {
-               W_MineLayer_Stick(other);
+               W_MineLayer_Stick(self, other);
        }
 }
 
@@ -308,8 +308,8 @@ void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float da
                W_PrepareExplosionByDamage(this, attacker, W_MineLayer_Explode);
 }
 
-void W_MineLayer_Attack(Weapon thiswep)
-{SELFPARAM();
+void W_MineLayer_Attack(Weapon thiswep, entity actor)
+{entity this = actor;
        entity mine;
        entity flash;
 
@@ -401,9 +401,9 @@ float W_MineLayer_PlacedMines(entity this, float detonate)
        return minfound;
 }
 
-METHOD(MineLayer, wr_aim, void(entity thiswep))
+METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     // aim and decide to fire if appropriate
     if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
         PHYS_INPUT_BUTTON_ATCK(self) = false;
@@ -513,7 +513,7 @@ METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponent
     {
         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(minelayer, refire)))
         {
-            W_MineLayer_Attack(thiswep);
+            W_MineLayer_Attack(thiswep, actor);
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(minelayer, animtime), w_ready);
         }
     }
@@ -543,15 +543,13 @@ METHOD(MineLayer, wr_checkammo2, bool(entity thiswep, entity actor))
     else
         return false;
 }
-METHOD(MineLayer, wr_resetplayers, void(entity thiswep))
+METHOD(MineLayer, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
-    self.minelayer_mines = 0;
+    actor.minelayer_mines = 0;
 }
 METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    SELFPARAM();
-    W_Reload(self, WEP_CVAR(minelayer, ammo), SND_RELOAD);
+    W_Reload(actor, WEP_CVAR(minelayer, ammo), SND_RELOAD);
 }
 METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep))
 {
@@ -565,9 +563,9 @@ METHOD(MineLayer, wr_killmessage, Notification(entity thiswep))
 #endif
 #ifdef CSQC
 
-METHOD(MineLayer, wr_impacteffect, void(entity thiswep))
+METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);