X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fhook.qc;h=7c4aabfe71e2b280e106bb4759cd893b81bf270d;hb=1a9e7607796f021c85d200ce66bdfb7f3932d882;hp=77e0e1973d4b20469a14c8e03a810bd7c85ce903;hpb=1add7fc6b9e512dcfcfd3180505046449ac782cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 77e0e1973..7c4aabfe7 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -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; 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,9 +137,9 @@ 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(); - PROJECTILE_TOUCH; +void W_Hook_Touch2(entity this) +{ + PROJECTILE_TOUCH(this); this.use(this, NULL, NULL); } @@ -159,7 +159,7 @@ 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; settouch(gren, W_Hook_Touch2); @@ -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);