]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hook.qc
Remove weapon SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hook.qc
index 206223d011889e967253bcdc69abc308781a0cc5..40f828f58f5a900a25f8e17409f4ed91afb0a4a7 100644 (file)
@@ -79,8 +79,8 @@ OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(Offhand
 
 spawnfunc(weapon_hook) { weapon_defaultspawnfunc(this, WEP_HOOK); }
 
-void W_Hook_ExplodeThink()
-{SELFPARAM();
+void W_Hook_ExplodeThink(entity this)
+{
        float dt, dmg_remaining_next, f;
 
        dt = time - self.teleport_time;
@@ -99,13 +99,13 @@ void W_Hook_ExplodeThink()
                remove(self);
 }
 
-void W_Hook_Explode2()
-{SELFPARAM();
+void W_Hook_Explode2(entity this)
+{
        self.event_damage = func_null;
-       self.touch = func_null;
+       settouch(self, func_null);
        self.effects |= EF_NODRAW;
 
-       self.think = W_Hook_ExplodeThink;
+       setthink(self, W_Hook_ExplodeThink);
        self.nextthink = time;
        self.dmg = WEP_CVAR_SEC(hook, damage);
        self.dmg_edge = WEP_CVAR_SEC(hook, edgedamage);
@@ -120,7 +120,7 @@ void W_Hook_Explode2()
 
 void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
 {
-       WITHSELF(this, W_Hook_Explode2());
+       WITHSELF(this, W_Hook_Explode2(this));
 }
 
 void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -137,8 +137,8 @@ void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage,
                W_PrepareExplosionByDamage(this, this.realowner, W_Hook_Explode2);
 }
 
-void W_Hook_Touch2()
-{SELFPARAM();
+void W_Hook_Touch2(entity this)
+{
        PROJECTILE_TOUCH;
        this.use(this, NULL, NULL);
 }
@@ -159,9 +159,9 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
        setsize(gren, '0 0 0', '0 0 0');
 
        gren.nextthink = time + WEP_CVAR_SEC(hook, lifetime);
-       gren.think = adaptor_think2use_hittype_splash;
+       setthink(gren, adaptor_think2use_hittype_splash);
        gren.use = W_Hook_Explode2_use;
-       gren.touch = W_Hook_Touch2;
+       settouch(gren, W_Hook_Touch2);
 
        gren.takedamage = DAMAGE_YES;
        gren.health = WEP_CVAR_SEC(hook, health);
@@ -277,9 +277,9 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
         actor.hook_state &= ~HOOK_REMOVING;
     }
 }
-METHOD(Hook, wr_setup, void(entity thiswep))
+METHOD(Hook, wr_setup, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
 }
 METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor))
@@ -295,9 +295,9 @@ METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor))
     // infinite ammo for now
     return true; // actor.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
 }
-METHOD(Hook, wr_resetplayer, void(entity thiswep))
+METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     RemoveGrapplingHook(self);
     self.hook_time = 0;
     self.hook_refire = time;
@@ -310,9 +310,9 @@ METHOD(Hook, wr_killmessage, Notification(entity thiswep))
 #endif
 #ifdef CSQC
 
-METHOD(Hook, wr_impacteffect, void(entity thiswep))
+METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);