]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/overkill/hmg.qc
Clean up some SELFPARAMs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / overkill / hmg.qc
index 38aec81e7af892696232edc568034a5ff32fab64..e0ae539318c3db8dd949079bf789dda1521a9e43 100644 (file)
@@ -47,17 +47,15 @@ REGISTER_WEAPON(HMG, hmg, NEW(HeavyMachineGun));
 REGISTER_MUTATOR(hmg_nadesupport, true);
 MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage)
 {
-    SELFPARAM();
-       if (M_ARGV(0, entity) != WEP_HMG) return;
+       if (M_ARGV(1, entity) != WEP_HMG) return;
        return = true;
-       M_ARGV(2, float) /* damage */ = self.max_health * 0.1;
+       M_ARGV(3, float) /* damage */ = (M_ARGV(0, entity)).max_health * 0.1;
 }
 
 spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(this, WEP_HMG); }
 
 void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {
-    SELFPARAM();
        if (!PHYS_INPUT_BUTTON_ATCK(actor))
        {
                w_ready(thiswep, actor, weaponentity, fire);
@@ -72,7 +70,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone
                return;
        }
 
-       W_DecreaseAmmo(WEP_HMG, self, WEP_CVAR(hmg, ammo));
+       W_DecreaseAmmo(WEP_HMG, actor, WEP_CVAR(hmg, ammo));
 
        W_SetupShot (actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR(hmg, damage));
 
@@ -102,11 +100,10 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone
 
 METHOD(HeavyMachineGun, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
+    if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
 }
 
 METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -146,8 +143,7 @@ METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep, entity actor))
 
 METHOD(HeavyMachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    SELFPARAM();
-    W_Reload(self, WEP_CVAR(hmg, ammo), SND_RELOAD);
+    W_Reload(actor, WEP_CVAR(hmg, ammo), SND_RELOAD);
 }
 
 METHOD(HeavyMachineGun, wr_suicidemessage, Notification(entity thiswep))
@@ -168,12 +164,11 @@ METHOD(HeavyMachineGun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
+        sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
 }
 
 #endif