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;
remove(self);
}
-void W_Hook_Explode2()
-{SELFPARAM();
+void W_Hook_Explode2(entity this)
+{
self.event_damage = 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);
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)
W_PrepareExplosionByDamage(this, this.realowner, W_Hook_Explode2);
}
-void W_Hook_Touch2()
-{SELFPARAM();
- PROJECTILE_TOUCH;
+void W_Hook_Touch2(entity this)
+{
+ PROJECTILE_TOUCH(this);
this.use(this, NULL, NULL);
}
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;
settouch(gren, W_Hook_Touch2);
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))
// 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;
#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);