]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/mortar.qc
Remove SELFPARAM() from .think and .touch
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / mortar.qc
index f871da725a38f45cdfff52237cc3877845b55970..5fa2447a784a7d0304ad5b567f87d92fe6467670 100644 (file)
@@ -128,8 +128,8 @@ void W_Mortar_Grenade_Damage(entity this, entity inflictor, entity attacker, flo
                W_PrepareExplosionByDamage(this, attacker, adaptor_think2use);
 }
 
-void W_Mortar_Grenade_Think1()
-{SELFPARAM();
+void W_Mortar_Grenade_Think1(entity this)
+{
        self.nextthink = time;
        if(time > self.cnt)
        {
@@ -142,12 +142,12 @@ void W_Mortar_Grenade_Think1()
                W_Mortar_Grenade_Explode();
 }
 
-void W_Mortar_Grenade_Touch1()
-{SELFPARAM();
+void W_Mortar_Grenade_Touch1(entity this)
+{
        PROJECTILE_TOUCH;
        if(other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
        {
-               this.use1(this, NULL, NULL);
+               this.use(this, NULL, NULL);
        }
        else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
        {
@@ -174,12 +174,12 @@ void W_Mortar_Grenade_Touch1()
        }
 }
 
-void W_Mortar_Grenade_Touch2()
-{SELFPARAM();
+void W_Mortar_Grenade_Touch2(entity this)
+{
        PROJECTILE_TOUCH;
        if(other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
        {
-               this.use1(this, NULL, NULL);
+               this.use(this, NULL, NULL);
        }
        else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
        {
@@ -235,9 +235,9 @@ void W_Mortar_Attack(Weapon thiswep)
 
        gren.cnt = time + WEP_CVAR_PRI(mortar, lifetime);
        gren.nextthink = time;
-       gren.think = W_Mortar_Grenade_Think1;
-       gren.use1 = W_Mortar_Grenade_Explode_use;
-       gren.touch = W_Mortar_Grenade_Touch1;
+       setthink(gren, W_Mortar_Grenade_Think1);
+       gren.use = W_Mortar_Grenade_Explode_use;
+       settouch(gren, W_Mortar_Grenade_Touch1);
 
        gren.takedamage = DAMAGE_YES;
        gren.health = WEP_CVAR_PRI(mortar, health);
@@ -282,9 +282,9 @@ void W_Mortar_Attack2(Weapon thiswep)
        setsize(gren, '-3 -3 -3', '3 3 3');
 
        gren.nextthink = time + WEP_CVAR_SEC(mortar, lifetime);
-       gren.think = adaptor_think2use_hittype_splash;
-       gren.use1 = W_Mortar_Grenade_Explode2_use;
-       gren.touch = W_Mortar_Grenade_Touch2;
+       setthink(gren, adaptor_think2use_hittype_splash);
+       gren.use = W_Mortar_Grenade_Explode2_use;
+       settouch(gren, W_Mortar_Grenade_Touch2);
 
        gren.takedamage = DAMAGE_YES;
        gren.health = WEP_CVAR_SEC(mortar, health);
@@ -381,18 +381,16 @@ METHOD(Mortar, wr_think, void(entity thiswep, entity actor, .entity weaponentity
         }
     }
 }
-METHOD(Mortar, wr_checkammo1, bool(entity thiswep))
+METHOD(Mortar, wr_checkammo1, bool(entity thiswep, entity actor))
 {
-    SELFPARAM();
-    float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(mortar, ammo);
-    ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_PRI(mortar, ammo);
+    float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_PRI(mortar, ammo);
+    ammo_amount += actor.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_PRI(mortar, ammo);
     return ammo_amount;
 }
-METHOD(Mortar, wr_checkammo2, bool(entity thiswep))
+METHOD(Mortar, wr_checkammo2, bool(entity thiswep, entity actor))
 {
-    SELFPARAM();
-    float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(mortar, ammo);
-    ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo);
+    float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(mortar, ammo);
+    ammo_amount += actor.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo);
     return ammo_amount;
 }
 METHOD(Mortar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))