From 66189615a05cc66dd0ee544a2bbc841c4f426193 Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 22 Mar 2016 18:28:21 +1100 Subject: [PATCH] Add missing SELFPARAM() --- qcsrc/client/shownames.qc | 1 + qcsrc/common/effects/qc/gibs.qc | 1 + qcsrc/common/gamemodes/gamemode/nexball/nexball.qc | 1 + qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc | 2 ++ qcsrc/common/minigames/minigame/snake.qc | 1 + qcsrc/common/monsters/monster/mage.qc | 1 + qcsrc/common/monsters/monster/spider.qc | 5 +++++ qcsrc/common/monsters/sv_monsters.qc | 1 + qcsrc/common/mutators/mutator/buffs/buffs.qc | 4 ++-- qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc | 3 +++ qcsrc/common/mutators/mutator/dodging/dodging.qc | 2 ++ qcsrc/common/mutators/mutator/doublejump/doublejump.qc | 1 + qcsrc/common/mutators/mutator/hook/hook.qc | 1 + qcsrc/common/mutators/mutator/multijump/multijump.qc | 2 ++ qcsrc/common/mutators/mutator/nades/nades.qc | 4 ++++ qcsrc/common/mutators/mutator/nix/nix.qc | 5 +++-- qcsrc/common/mutators/mutator/overkill/hmg.qc | 7 +++++++ qcsrc/common/mutators/mutator/overkill/rpc.qc | 4 ++++ qcsrc/common/mutators/mutator/superspec/superspec.qc | 1 + qcsrc/common/triggers/func/ladder.qc | 2 ++ qcsrc/common/triggers/func/train.qc | 1 + qcsrc/common/triggers/target/music.qc | 1 + qcsrc/common/triggers/teleporters.qc | 1 + qcsrc/common/triggers/trigger/impulse.qc | 1 + qcsrc/common/triggers/trigger/jumppads.qc | 1 + qcsrc/common/turrets/turret/fusionreactor.qc | 1 + qcsrc/common/turrets/turret/hellion.qc | 1 + qcsrc/common/turrets/turret/hk.qc | 1 + qcsrc/common/turrets/turret/mlrs.qc | 1 + qcsrc/common/turrets/turret/phaser.qc | 1 + qcsrc/common/turrets/turret/plasma.qc | 1 + qcsrc/common/turrets/turret/plasma_dual.qc | 6 ++++-- qcsrc/common/turrets/turret/tesla.qc | 1 + qcsrc/common/turrets/turret/walker.qc | 1 + qcsrc/common/vehicles/vehicle/bumblebee.qc | 1 + qcsrc/common/vehicles/vehicle/racer.qc | 3 +++ qcsrc/common/vehicles/vehicle/raptor.qc | 4 ++++ qcsrc/common/vehicles/vehicle/spiderbot.qc | 4 ++++ qcsrc/common/weapons/all.qh | 1 + qcsrc/common/weapons/weapon/arc.qc | 3 +++ qcsrc/common/weapons/weapon/blaster.qc | 3 +++ qcsrc/common/weapons/weapon/crylink.qc | 1 + qcsrc/common/weapons/weapon/devastator.qc | 6 ++++++ qcsrc/common/weapons/weapon/electro.qc | 6 ++++++ qcsrc/common/weapons/weapon/fireball.qc | 4 ++++ qcsrc/common/weapons/weapon/hagar.qc | 9 +++++++++ qcsrc/common/weapons/weapon/hlac.qc | 5 +++++ qcsrc/common/weapons/weapon/hook.qc | 5 +++++ qcsrc/common/weapons/weapon/machinegun.qc | 5 +++++ qcsrc/common/weapons/weapon/minelayer.qc | 5 +++++ qcsrc/common/weapons/weapon/mortar.qc | 5 +++++ qcsrc/common/weapons/weapon/rifle.qc | 6 ++++++ qcsrc/common/weapons/weapon/seeker.qc | 5 +++++ qcsrc/common/weapons/weapon/shockwave.qc | 1 + qcsrc/common/weapons/weapon/shotgun.qc | 6 ++++++ qcsrc/common/weapons/weapon/tuba.qc | 2 +- qcsrc/common/weapons/weapon/vaporizer.qc | 7 +++++++ qcsrc/common/weapons/weapon/vortex.qc | 7 +++++++ qcsrc/lib/csqcmodel/sv_model.qc | 1 + qcsrc/lib/net.qh | 3 ++- qcsrc/server/cl_client.qc | 1 + qcsrc/server/g_damage.qc | 1 + qcsrc/server/g_world.qc | 1 + qcsrc/server/mutators/mutator/gamemode_assault.qc | 2 ++ qcsrc/server/mutators/mutator/gamemode_ca.qc | 1 + qcsrc/server/mutators/mutator/gamemode_ctf.qc | 1 + qcsrc/server/mutators/mutator/gamemode_cts.qc | 1 + qcsrc/server/mutators/mutator/gamemode_freezetag.qc | 1 + qcsrc/server/mutators/mutator/gamemode_keyhunt.qc | 1 + qcsrc/server/mutators/mutator/gamemode_lms.qc | 1 + qcsrc/server/scores.qc | 1 + qcsrc/server/spawnpoints.qc | 1 + qcsrc/server/weapons/selection.qc | 1 + qcsrc/server/weapons/weaponsystem.qc | 2 ++ 74 files changed, 184 insertions(+), 8 deletions(-) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index bfbba30fb..ea1d1f9ca 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -167,6 +167,7 @@ void Draw_ShowNames(entity this) void Draw_ShowNames_All() { + SELFPARAM(); if (!autocvar_hud_shownames) return; LL_EACH(shownames_ent, true, { entity entcs = entcs_receiver(i); diff --git a/qcsrc/common/effects/qc/gibs.qc b/qcsrc/common/effects/qc/gibs.qc index 45a28a9b4..bbe3ad934 100644 --- a/qcsrc/common/effects/qc/gibs.qc +++ b/qcsrc/common/effects/qc/gibs.qc @@ -113,6 +113,7 @@ void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany) void SUB_RemoveOnNoImpact() { + SELFPARAM(); if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) Gib_Delete(self); } diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index cb856ff13..14ab8b470 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -854,6 +854,7 @@ float ball_customize() METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire)) { + SELFPARAM(); TC(BallStealer, thiswep); if(fire & 1) if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire)) diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 0b030b251..c17c78659 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -2130,6 +2130,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayHitsound) MUTATOR_HOOKFUNCTION(ons, SendWaypoint) { + SELFPARAM(); if(wp_sendflags & 16) { if(self.owner.classname == "onslaught_controlpoint") @@ -2163,6 +2164,7 @@ MUTATOR_HOOKFUNCTION(ons, TurretValidateTarget) MUTATOR_HOOKFUNCTION(ons, TurretThink) { + SELFPARAM(); // ONS uses somewhat backwards linking. if(self.target) { diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index 33868ad57..d367472d8 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -155,6 +155,7 @@ void snake_check_winner(entity minigame) void snake_move_head(entity minigame, entity head); void snake_head_think() { + SELFPARAM(); entity minigame = self.owner; if(minigame.minigame_flags & SNAKE_TURN_MOVE) diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index c67729ee1..66ea47f25 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -162,6 +162,7 @@ void M_Mage_Attack_Spike_Explode(entity this) void M_Mage_Attack_Spike_Touch() { + SELFPARAM(); PROJECTILE_TOUCH; M_Mage_Attack_Spike_Explode(self); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index defa719df..2c0ecdc48 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -56,6 +56,7 @@ REGISTER_MUTATOR(spiderweb, true); MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics) { + SELFPARAM(); if (time >= self.spider_slowness) return false; PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider @@ -67,6 +68,7 @@ MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics) MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove) { + SELFPARAM(); if(time < self.spider_slowness) { monster_speed_run *= 0.5; @@ -77,12 +79,14 @@ MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove) MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn) { + SELFPARAM(); self.spider_slowness = 0; return false; } MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn) { + SELFPARAM(); self.spider_slowness = 0; return false; } @@ -90,6 +94,7 @@ MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn) SOUND(SpiderAttack_FIRE, W_Sound("electro_fire")); METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire)) { + SELFPARAM(); TC(SpiderAttack, thiswep); bool isPlayer = IS_PLAYER(actor); if (fire & 1) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 8f1d80276..5910d5b26 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -211,6 +211,7 @@ void Monster_Delay_Action(entity this) void Monster_Delay_Action_self() { + SELFPARAM(); Monster_Delay_Action(self); } diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 30e19f0f5..61d4dc80a 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -785,8 +785,8 @@ bool buffs_RemovePlayer(entity player) return false; } -MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver) { return buffs_RemovePlayer(self); } -MUTATOR_HOOKFUNCTION(buffs, ClientDisconnect) { return buffs_RemovePlayer(self); } +MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver) { SELFPARAM(); return buffs_RemovePlayer(self); } +MUTATOR_HOOKFUNCTION(buffs, ClientDisconnect) { SELFPARAM(); return buffs_RemovePlayer(self); } MUTATOR_HOOKFUNCTION(buffs, CustomizeWaypoint) {SELFPARAM(); diff --git a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc index 796b3d395..fa30be11c 100644 --- a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc +++ b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc @@ -271,6 +271,7 @@ void RaceCarPhysics(entity this) #endif MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics) { + SELFPARAM(); if(!PHYS_BUGRIGS(self) || !IS_PLAYER(self)) { return false; } #ifdef SVQC @@ -283,6 +284,7 @@ MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics) MUTATOR_HOOKFUNCTION(bugrigs, PlayerPhysics) { + SELFPARAM(); if(!PHYS_BUGRIGS(self)) { return false; } #ifdef SVQC self.bugrigs_prevangles = self.angles; @@ -294,6 +296,7 @@ MUTATOR_HOOKFUNCTION(bugrigs, PlayerPhysics) MUTATOR_HOOKFUNCTION(bugrigs, ClientConnect) { + SELFPARAM(); stuffcmd(self, "cl_cmd settemp chase_active 1\n"); return false; } diff --git a/qcsrc/common/mutators/mutator/dodging/dodging.qc b/qcsrc/common/mutators/mutator/dodging/dodging.qc index 1707d0a9d..8e2ece083 100644 --- a/qcsrc/common/mutators/mutator/dodging/dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/dodging.qc @@ -267,6 +267,7 @@ void PM_dodging_GetPressedKeys(entity this) MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics) { + SELFPARAM(); // print("dodging_PlayerPhysics\n"); PM_dodging_GetPressedKeys(self); PM_dodging(self); @@ -279,6 +280,7 @@ REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout"); MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys) { + SELFPARAM(); PM_dodging_checkpressedkeys(self); return false; } diff --git a/qcsrc/common/mutators/mutator/doublejump/doublejump.qc b/qcsrc/common/mutators/mutator/doublejump/doublejump.qc index cb89f32b0..144e87ae8 100644 --- a/qcsrc/common/mutators/mutator/doublejump/doublejump.qc +++ b/qcsrc/common/mutators/mutator/doublejump/doublejump.qc @@ -15,6 +15,7 @@ REGISTER_MUTATOR(doublejump, true); MUTATOR_HOOKFUNCTION(doublejump, PlayerJump) { + SELFPARAM(); if (PHYS_DOUBLEJUMP(self)) { tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); diff --git a/qcsrc/common/mutators/mutator/hook/hook.qc b/qcsrc/common/mutators/mutator/hook/hook.qc index b298e7b2e..388ee81a0 100644 --- a/qcsrc/common/mutators/mutator/hook/hook.qc +++ b/qcsrc/common/mutators/mutator/hook/hook.qc @@ -35,6 +35,7 @@ MUTATOR_HOOKFUNCTION(hook, PlayerSpawn) MUTATOR_HOOKFUNCTION(hook, FilterItem) { + SELFPARAM(); return self.weapon == WEP_HOOK.m_id; } diff --git a/qcsrc/common/mutators/mutator/multijump/multijump.qc b/qcsrc/common/mutators/mutator/multijump/multijump.qc index c4a2e40fc..14c854df9 100644 --- a/qcsrc/common/mutators/mutator/multijump/multijump.qc +++ b/qcsrc/common/mutators/mutator/multijump/multijump.qc @@ -99,6 +99,7 @@ bool PM_multijump_checkjump(entity this) MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics) { + SELFPARAM(); #ifdef CSQC self.multijump_count = PHYS_MULTIJUMP_COUNT(self); #endif @@ -111,6 +112,7 @@ MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics) MUTATOR_HOOKFUNCTION(multijump, PlayerJump) { + SELFPARAM(); return PM_multijump_checkjump(self); } diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 1a82c28a6..2e34c6de7 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -44,6 +44,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, HUD_Draw_overlay) } MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile) { + SELFPARAM(); if (self.cnt == PROJECTILE_NAPALM_FOUNTAIN) { self.modelindex = 0; @@ -60,6 +61,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile) } MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile) { + SELFPARAM(); if (self.cnt == PROJECTILE_NAPALM_FOUNTAIN) { loopsound(self, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM); @@ -923,6 +925,7 @@ void nades_RemoveBonus(entity player) MUTATOR_HOOKFUNCTION(nades, PutClientInServer) { + SELFPARAM(); nades_RemoveBonus(self); } @@ -1128,6 +1131,7 @@ NadeOffhand OFFHAND_NADE; STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOff MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST) { + SELFPARAM(); if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) { nades_CheckThrow(); return true; diff --git a/qcsrc/common/mutators/mutator/nix/nix.qc b/qcsrc/common/mutators/mutator/nix/nix.qc index d265d3318..0b6908a8b 100644 --- a/qcsrc/common/mutators/mutator/nix/nix.qc +++ b/qcsrc/common/mutators/mutator/nix/nix.qc @@ -36,6 +36,7 @@ bool NIX_CanChooseWeapon(int wpn); REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill")) { + SELFPARAM(); MUTATOR_ONADD { g_nix_with_blaster = autocvar_g_nix_with_blaster; @@ -54,7 +55,7 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill" MUTATOR_ONREMOVE { // as the PlayerSpawn hook will no longer run, NIX is turned off by this! - FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA( + FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), { it.ammo_cells = start_ammo_cells; it.ammo_plasma = start_ammo_plasma; it.ammo_shells = start_ammo_shells; @@ -64,7 +65,7 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill" it.weapons = start_weapons; if(!client_hasweapon(it, PS(it).m_weapon, true, false)) PS(it).m_switchweapon = w_getbestweapon(self); - )); + }); } return 0; diff --git a/qcsrc/common/mutators/mutator/overkill/hmg.qc b/qcsrc/common/mutators/mutator/overkill/hmg.qc index 46f79ccc4..cf7174a69 100644 --- a/qcsrc/common/mutators/mutator/overkill/hmg.qc +++ b/qcsrc/common/mutators/mutator/overkill/hmg.qc @@ -47,6 +47,7 @@ REGISTER_WEAPON(HMG, hmg, NEW(HeavyMachineGun)); REGISTER_MUTATOR(hmg_nadesupport, true); MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage) { + SELFPARAM(); if (MUTATOR_ARGV(0, entity) != WEP_HMG) return; return = true; MUTATOR_ARGV(0, float) /* damage */ = self.max_health * 0.1; @@ -56,6 +57,7 @@ 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); @@ -100,6 +102,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone METHOD(HeavyMachineGun, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200)) PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false); else @@ -123,6 +126,7 @@ METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity wea METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo); if(autocvar_g_balance_hmg_reload_ammo) @@ -133,6 +137,7 @@ METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep)) METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo); if(autocvar_g_balance_hmg_reload_ammo) @@ -143,6 +148,7 @@ METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep)) METHOD(HeavyMachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, WEP_CVAR(hmg, ammo), SND_RELOAD); } @@ -164,6 +170,7 @@ METHOD(HeavyMachineGun, wr_killmessage, Notification(entity thiswep)) METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 2; pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1); diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 90af86d58..79c491b56 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -152,6 +152,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false); } @@ -179,6 +180,7 @@ METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .en METHOD(RocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(rpc, ammo); ammo_amount += self.(weapon_load[WEP_RPC.m_id]) >= WEP_CVAR(rpc, ammo); return ammo_amount; @@ -191,6 +193,7 @@ METHOD(RocketPropelledChainsaw, wr_checkammo2, bool(entity thiswep)) METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, WEP_CVAR(rpc, ammo), SND_RELOAD); } @@ -218,6 +221,7 @@ METHOD(RocketPropelledChainsaw, wr_killmessage, Notification(entity thiswep)) METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 12; pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/mutators/mutator/superspec/superspec.qc b/qcsrc/common/mutators/mutator/superspec/superspec.qc index b7a596cdf..fa2a80aa9 100644 --- a/qcsrc/common/mutators/mutator/superspec/superspec.qc +++ b/qcsrc/common/mutators/mutator/superspec/superspec.qc @@ -440,6 +440,7 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect) MUTATOR_HOOKFUNCTION(superspec, PlayerDies) { + SELFPARAM(); FOREACH_CLIENT(IS_SPEC(it), LAMBDA( setself(it); if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == frag_target) diff --git a/qcsrc/common/triggers/func/ladder.qc b/qcsrc/common/triggers/func/ladder.qc index 44687de4a..04c5c2563 100644 --- a/qcsrc/common/triggers/func/ladder.qc +++ b/qcsrc/common/triggers/func/ladder.qc @@ -34,6 +34,7 @@ bool func_ladder_send(entity to, int sf) void func_ladder_link() { + SELFPARAM(); self.SendEntity = func_ladder_send; self.SendFlags = 0xFFFFFF; //self.model = "null"; @@ -41,6 +42,7 @@ void func_ladder_link() void func_ladder_init() { + SELFPARAM(); self.touch = func_ladder_touch; trigger_init(self); diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index e7567c500..77bb7b870 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -178,6 +178,7 @@ void train_link() void train_use() { + SELFPARAM(); self.SUB_NEXTTHINK = self.SUB_LTIME + 1; self.SUB_THINK = train_next; self.use = func_null; // not again diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 52f1fca0e..1873d64a0 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -36,6 +36,7 @@ void target_music_reset(entity this) } void target_music_kill() { + SELFPARAM(); for(self = world; (self = find(self, classname, "target_music")); ) { self.volume = 0; diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 40ba61f65..52324733f 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -248,6 +248,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) void teleport_findtarget() { + SELFPARAM(); int n = 0; entity e; for(e = world; (e = find(e, targetname, self.target)); ) diff --git a/qcsrc/common/triggers/trigger/impulse.qc b/qcsrc/common/triggers/trigger/impulse.qc index c2b59a3e0..b4b146c7f 100644 --- a/qcsrc/common/triggers/trigger/impulse.qc +++ b/qcsrc/common/triggers/trigger/impulse.qc @@ -181,6 +181,7 @@ bool trigger_impulse_send(entity this, entity to, int sf) void trigger_impulse_link() { + SELFPARAM(); trigger_link(self, trigger_impulse_send); } diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 141fd458f..de8458e9f 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -361,6 +361,7 @@ void trigger_push_updatelink() void trigger_push_link() { + SELFPARAM(); trigger_link(self, trigger_push_send); } diff --git a/qcsrc/common/turrets/turret/fusionreactor.qc b/qcsrc/common/turrets/turret/fusionreactor.qc index 8ea1cbbd4..5c253d4c5 100644 --- a/qcsrc/common/turrets/turret/fusionreactor.qc +++ b/qcsrc/common/turrets/turret/fusionreactor.qc @@ -56,6 +56,7 @@ METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it)) } METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it)) { + SELFPARAM(); self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max); } METHOD(FusionReactor, tr_setup, void(FusionReactor this, entity it)) diff --git a/qcsrc/common/turrets/turret/hellion.qc b/qcsrc/common/turrets/turret/hellion.qc index 6f5d6f6bd..3eec587b2 100644 --- a/qcsrc/common/turrets/turret/hellion.qc +++ b/qcsrc/common/turrets/turret/hellion.qc @@ -28,6 +28,7 @@ spawnfunc(turret_hellion) { if (!turret_initialize(TUR_HELLION)) remove(self); } METHOD(Hellion, tr_think, void(Hellion thistur, entity it)) { + SELFPARAM(); if (self.tur_head.frame != 0) self.tur_head.frame += 1; diff --git a/qcsrc/common/turrets/turret/hk.qc b/qcsrc/common/turrets/turret/hk.qc index 945dd48af..a1a7e096d 100644 --- a/qcsrc/common/turrets/turret/hk.qc +++ b/qcsrc/common/turrets/turret/hk.qc @@ -34,6 +34,7 @@ spawnfunc(turret_hk) { if(!turret_initialize(TUR_HK)) remove(self); } METHOD(HunterKiller, tr_think, void(HunterKiller thistur, entity it)) { + SELFPARAM(); if (self.tur_head.frame != 0) self.tur_head.frame = self.tur_head.frame + 1; diff --git a/qcsrc/common/turrets/turret/mlrs.qc b/qcsrc/common/turrets/turret/mlrs.qc index c1302548d..c5f6865cc 100644 --- a/qcsrc/common/turrets/turret/mlrs.qc +++ b/qcsrc/common/turrets/turret/mlrs.qc @@ -28,6 +28,7 @@ spawnfunc(turret_mlrs) { if (!turret_initialize(TUR_MLRS)) remove(self); } METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it)) { + SELFPARAM(); // 0 = full, 6 = empty self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6); if(self.tur_head.frame < 0) diff --git a/qcsrc/common/turrets/turret/phaser.qc b/qcsrc/common/turrets/turret/phaser.qc index edfa88f52..5c973c65a 100644 --- a/qcsrc/common/turrets/turret/phaser.qc +++ b/qcsrc/common/turrets/turret/phaser.qc @@ -28,6 +28,7 @@ spawnfunc(turret_phaser) { if (!turret_initialize(TUR_PHASER)) remove(self); } METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it)) { + SELFPARAM(); if (self.tur_head.frame != 0) { if (self.fireflag == 1) diff --git a/qcsrc/common/turrets/turret/plasma.qc b/qcsrc/common/turrets/turret/plasma.qc index 37bdd9329..4982bff56 100644 --- a/qcsrc/common/turrets/turret/plasma.qc +++ b/qcsrc/common/turrets/turret/plasma.qc @@ -48,6 +48,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it)) } METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it)) { + SELFPARAM(); if (self.tur_head.frame != 0) self.tur_head.frame = self.tur_head.frame + 1; diff --git a/qcsrc/common/turrets/turret/plasma_dual.qc b/qcsrc/common/turrets/turret/plasma_dual.qc index 183d4d965..1518a3008 100644 --- a/qcsrc/common/turrets/turret/plasma_dual.qc +++ b/qcsrc/common/turrets/turret/plasma_dual.qc @@ -28,8 +28,9 @@ REGISTER_TURRET(PLASMA_DUAL, NEW(DualPlasmaTurret)); spawnfunc(turret_plasma_dual) { if (!turret_initialize(TUR_PLASMA_DUAL)) remove(self); } -METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this, entity it)) +METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it)) { + SELFPARAM(); if (g_instagib) { FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); @@ -41,12 +42,13 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this, entity it)) vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v); } else { - SUPER(PlasmaTurret).tr_attack(this, it); + SUPER(PlasmaTurret).tr_attack(thistur, it); } self.tur_head.frame += 1; } METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it)) { + SELFPARAM(); if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3)) self.tur_head.frame = self.tur_head.frame + 1; diff --git a/qcsrc/common/turrets/turret/tesla.qc b/qcsrc/common/turrets/turret/tesla.qc index 1b61b4ae8..de45078a1 100644 --- a/qcsrc/common/turrets/turret/tesla.qc +++ b/qcsrc/common/turrets/turret/tesla.qc @@ -28,6 +28,7 @@ spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(self); } METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur, entity it)) { + SELFPARAM(); if(!self.active) { self.tur_head.avelocity = '0 0 0'; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index bf68e85fd..9582f2d1f 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -350,6 +350,7 @@ spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER)) remove(self); } METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it)) { + SELFPARAM(); fixedmakevectors(self.angles); if (self.spawnflags & TSF_NO_PATHBREAK && self.pathcurrent) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index e15bed0f3..d795d2a46 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -788,6 +788,7 @@ METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance)) } METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance)) { + SELFPARAM(); entity oldself = self; setself(instance); diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 5277faa37..6d0a2b978 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -578,6 +578,7 @@ METHOD(Racer, vr_impact, void(Racer thisveh, entity instance)) METHOD(Racer, vr_enter, void(Racer thisveh, entity instance)) { + SELFPARAM(); #ifdef SVQC self.movetype = MOVETYPE_BOUNCE; self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health) * 100; @@ -593,6 +594,7 @@ METHOD(Racer, vr_enter, void(Racer thisveh, entity instance)) METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance)) { + SELFPARAM(); #ifdef SVQC if(self.scale != 0.5) { @@ -674,6 +676,7 @@ METHOD(Racer, vr_crosshair, void(Racer thisveh)) #endif METHOD(Racer, vr_setup, void(Racer thisveh, entity instance)) { + SELFPARAM(); #ifdef SVQC self.vehicle_exit = racer_exit; #endif diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 159551b8b..a90fee3ef 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -626,6 +626,7 @@ METHOD(Raptor, vr_impact, void(Raptor thisveh, entity instance)) } METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance)) { + SELFPARAM(); self.vehicle_weapon2mode = RSM_BOMB; self.owner.PlayerPhysplug = raptor_takeoff; self.movetype = MOVETYPE_BOUNCEMISSILE; @@ -667,6 +668,7 @@ METHOD(Raptor, vr_death, void(Raptor thisveh, entity instance)) } METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) { + SELFPARAM(); if(!self.gun1) { entity spinner; @@ -758,6 +760,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) } METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance)) { + SELFPARAM(); if(autocvar_g_vehicle_raptor_shield) self.vehicle_flags |= VHF_HASSHIELD; @@ -788,6 +791,7 @@ METHOD(Raptor, vr_hud, void(Raptor thisveh)) } METHOD(Raptor, vr_crosshair, void(Raptor thisveh)) { + SELFPARAM(); string crosshair; switch(weapon2mode) diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 2012ced1f..253531f09 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -562,6 +562,7 @@ METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance)) } METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance)) { + SELFPARAM(); self.vehicle_weapon2mode = SBRM_GUIDE; self.movetype = MOVETYPE_WALK; CSQCVehicleSetup(self.owner, 0); @@ -576,6 +577,7 @@ METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance)) } METHOD(Spiderbot, vr_think, void(Spiderbot thisveh, entity instance)) { + SELFPARAM(); if(IS_ONGROUND(self)) movelib_brake_simple(self, autocvar_g_vehicle_spiderbot_speed_stop); } @@ -599,6 +601,7 @@ METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance)) } METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance)) { + SELFPARAM(); if(!self.gun1) { self.vehicles_impulse = spiderbot_impulse; @@ -630,6 +633,7 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance)) } METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance)) { + SELFPARAM(); if(autocvar_g_vehicle_spiderbot_shield) self.vehicle_flags |= VHF_HASSHIELD; diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 7fe6cef93..cdf78c924 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -113,6 +113,7 @@ void W_PROP_think() } STATIC_INIT_LATE(W_PROP_reloader) { + SELFPARAM(); entity e = W_PROP_reloader = new_pure(W_PROP_reloader); WITH(entity, self, e, (e.think = W_PROP_think)()); } diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index b8605c93b..658ca935f 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -851,6 +851,7 @@ METHOD(Arc, wr_killmessage, Notification(entity thiswep)) } METHOD(Arc, wr_drop, void(entity thiswep)) { + SELFPARAM(); weapon_dropevent_item.arc_overheat = self.arc_overheat; weapon_dropevent_item.arc_cooldown = self.arc_cooldown; self.arc_overheat = 0; @@ -858,6 +859,7 @@ METHOD(Arc, wr_drop, void(entity thiswep)) } METHOD(Arc, wr_pickup, void(entity thiswep)) { + SELFPARAM(); if ( !client_hasweapon(self, thiswep, false, false) && weapon_dropevent_item.arc_overheat > time ) { @@ -871,6 +873,7 @@ bool autocvar_cl_arcbeam_teamcolor = true; METHOD(Arc, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); if(w_deathtype & HITTYPE_SECONDARY) { vector org2; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index fae9e9f1a..cf1242aa4 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -152,6 +152,7 @@ void W_Blaster_Attack( METHOD(Blaster, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(WEP_CVAR(blaster, secondary)) { if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage)) @@ -224,6 +225,7 @@ METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponenti METHOD(Blaster, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.ammo_field = ammo_none; } @@ -252,6 +254,7 @@ METHOD(Blaster, wr_killmessage, Notification(entity thiswep)) METHOD(Blaster, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 6; pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 242980ede..4e912851f 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -655,6 +655,7 @@ METHOD(Crylink, wr_checkammo2, bool(entity thiswep)) } METHOD(Crylink, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND_RELOAD); } METHOD(Crylink, wr_suicidemessage, Notification(entity thiswep)) diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 8a8c4073e..e1c6ae116 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -434,6 +434,7 @@ METHOD(Devastator, wr_aim, void(entity thiswep)) #else METHOD(Devastator, wr_aim, void(entity thiswep)) { + SELFPARAM(); // aim and decide to fire if appropriate PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false); if(skill >= 2) // skill 0 and 1 bots won't detonate rockets! @@ -557,10 +558,12 @@ METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponen } METHOD(Devastator, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.rl_release = 1; } METHOD(Devastator, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); #if 0 // don't switch while guiding a missile if(ATTACK_FINISHED(self, slot) <= time || PS(self).m_weapon != WEP_DEVASTATOR) @@ -601,11 +604,13 @@ METHOD(Devastator, wr_checkammo2, bool(entity thiswep)) } METHOD(Devastator, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.lastrocket = NULL; // stop rocket guiding, no revenge from the grave! self.rl_release = 0; } METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, WEP_CVAR(devastator, ammo), SND_RELOAD); } METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep)) @@ -625,6 +630,7 @@ METHOD(Devastator, wr_killmessage, Notification(entity thiswep)) METHOD(Devastator, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 12; pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 4bae090de..cc540b86b 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -427,6 +427,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i METHOD(Electro, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false; if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; } if(self.bot_secondary_electromooth == 0) @@ -492,12 +493,14 @@ METHOD(Electro, wr_think, void(entity thiswep, entity actor, .entity weaponentit } METHOD(Electro, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(electro, ammo); ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo); return ammo_amount; } METHOD(Electro, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount; if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false. { @@ -513,10 +516,12 @@ METHOD(Electro, wr_checkammo2, bool(entity thiswep)) } METHOD(Electro, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.electro_secondarytime = time; } METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD); } METHOD(Electro, wr_suicidemessage, Notification(entity thiswep)) @@ -546,6 +551,7 @@ METHOD(Electro, wr_killmessage, Notification(entity thiswep)) METHOD(Electro, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 7d87a5a86..a4632eb11 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -353,6 +353,7 @@ void W_Fireball_Attack2() METHOD(Fireball, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = false; PHYS_INPUT_BUTTON_ATCK2(self) = false; if(self.bot_primary_fireballmooth == 0) @@ -394,6 +395,7 @@ METHOD(Fireball, wr_think, void(entity thiswep, entity actor, .entity weaponenti } METHOD(Fireball, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.ammo_field = ammo_none; } METHOD(Fireball, wr_checkammo1, bool(entity thiswep)) @@ -406,6 +408,7 @@ METHOD(Fireball, wr_checkammo2, bool(entity thiswep)) } METHOD(Fireball, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.fireball_primarytime = time; } METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep)) @@ -428,6 +431,7 @@ METHOD(Fireball, wr_killmessage, Notification(entity thiswep)) METHOD(Fireball, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; if(w_deathtype & HITTYPE_SECONDARY) { diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 609b59ec8..3204fa938 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -399,6 +399,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, .entity weaponentity) METHOD(Hagar, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(random()>0.15) PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false); else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming @@ -432,6 +433,7 @@ METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, } METHOD(Hagar, wr_gonethink, void(entity thiswep)) { + SELFPARAM(); // we lost the weapon and want to prepare switching away if(self.hagar_load) { @@ -442,6 +444,7 @@ METHOD(Hagar, wr_gonethink, void(entity thiswep)) } METHOD(Hagar, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.hagar_loadblock = false; if(self.hagar_load) @@ -452,22 +455,26 @@ METHOD(Hagar, wr_setup, void(entity thiswep)) } METHOD(Hagar, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(hagar, ammo); ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_PRI(hagar, ammo); return ammo_amount; } METHOD(Hagar, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(hagar, ammo); ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo); return ammo_amount; } METHOD(Hagar, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.hagar_load = 0; } METHOD(Hagar, wr_playerdeath, void(entity thiswep)) { + SELFPARAM(); .entity weaponentity = weaponentities[0]; // TODO: unhardcode // if we have any rockets loaded when we die, release them if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath)) @@ -475,6 +482,7 @@ METHOD(Hagar, wr_playerdeath, void(entity thiswep)) } METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); if(!self.hagar_load) // require releasing loaded rockets first W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD); } @@ -495,6 +503,7 @@ METHOD(Hagar, wr_killmessage, Notification(entity thiswep)) METHOD(Hagar, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 6; pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 03bec9ba9..b0d57951b 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -209,6 +209,7 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) METHOD(HLAC, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false); } METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) @@ -236,18 +237,21 @@ METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, } METHOD(HLAC, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(hlac, ammo); ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_PRI(hlac, ammo); return ammo_amount; } METHOD(HLAC, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(hlac, ammo); ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_SEC(hlac, ammo); return ammo_amount; } METHOD(HLAC, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND_RELOAD); } METHOD(HLAC, wr_suicidemessage, Notification(entity thiswep)) @@ -264,6 +268,7 @@ METHOD(HLAC, wr_killmessage, Notification(entity thiswep)) METHOD(HLAC, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 6; pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 7090acc8f..c335e8c5b 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -182,6 +182,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor) METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { + SELFPARAM(); if (fire & 1) { if(!actor.hook) if(!(actor.hook_state & HOOK_WAITING_FOR_RELEASE)) @@ -274,10 +275,12 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, } METHOD(Hook, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.hook_state &= ~HOOK_WAITING_FOR_RELEASE; } METHOD(Hook, wr_checkammo1, bool(Hook thiswep)) { + SELFPARAM(); if (!thiswep.ammo_factor) return true; if(self.hook) return self.ammo_fuel > 0; @@ -291,6 +294,7 @@ METHOD(Hook, wr_checkammo2, bool(Hook thiswep)) } METHOD(Hook, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); RemoveGrapplingHook(self); self.hook_time = 0; self.hook_refire = time; @@ -305,6 +309,7 @@ METHOD(Hook, wr_killmessage, Notification(entity thiswep)) METHOD(Hook, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 2; pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 96703b713..ddf7a281c 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -244,6 +244,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit METHOD(MachineGun, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200)) PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false); else @@ -302,6 +303,7 @@ METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponen } METHOD(MachineGun, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount; if(WEP_CVAR(machinegun, mode) == 1) ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(machinegun, sustained_ammo); @@ -319,6 +321,7 @@ METHOD(MachineGun, wr_checkammo1, bool(entity thiswep)) } METHOD(MachineGun, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount; if(WEP_CVAR(machinegun, mode) == 1) ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(machinegun, burst_ammo); @@ -336,6 +339,7 @@ METHOD(MachineGun, wr_checkammo2, bool(entity thiswep)) } METHOD(MachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND_RELOAD); } METHOD(MachineGun, wr_suicidemessage, Notification(entity thiswep)) @@ -355,6 +359,7 @@ METHOD(MachineGun, wr_killmessage, Notification(entity thiswep)) METHOD(MachineGun, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 2; pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index a0b7cc3e1..520d293be 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -406,6 +406,7 @@ float W_MineLayer_PlacedMines(float detonate) METHOD(MineLayer, wr_aim, void(entity thiswep)) { + SELFPARAM(); // aim and decide to fire if appropriate if(self.minelayer_mines >= WEP_CVAR(minelayer, limit)) PHYS_INPUT_BUTTON_ATCK(self) = false; @@ -528,6 +529,7 @@ METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponent } METHOD(MineLayer, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); int slot = 0; // TODO: unhardcode // don't switch while placing a mine if(ATTACK_FINISHED(self, slot) <= time || PS(self).m_weapon != WEP_MINE_LAYER) @@ -547,10 +549,12 @@ METHOD(MineLayer, wr_checkammo2, bool(entity thiswep)) } METHOD(MineLayer, wr_resetplayers, void(entity thiswep)) { + SELFPARAM(); self.minelayer_mines = 0; } METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, WEP_CVAR(minelayer, ammo), SND_RELOAD); } METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep)) @@ -567,6 +571,7 @@ METHOD(MineLayer, wr_killmessage, Notification(entity thiswep)) METHOD(MineLayer, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 12; pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index f3a43d840..eb261aece 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -300,6 +300,7 @@ void W_Mortar_Attack2(Weapon thiswep) METHOD(Mortar, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = false; PHYS_INPUT_BUTTON_ATCK2(self) = false; if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH @@ -373,18 +374,21 @@ METHOD(Mortar, wr_think, void(entity thiswep, entity actor, .entity weaponentity } METHOD(Mortar, wr_checkammo1, bool(entity thiswep)) { + 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); return ammo_amount; } METHOD(Mortar, wr_checkammo2, bool(entity thiswep)) { + 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); return ammo_amount; } METHOD(Mortar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND_RELOAD); // WEAPONTODO } METHOD(Mortar, wr_suicidemessage, Notification(entity thiswep)) @@ -407,6 +411,7 @@ METHOD(Mortar, wr_killmessage, Notification(entity thiswep)) METHOD(Mortar, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 12; pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1); diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index b008f8a1b..92b054586 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -140,6 +140,7 @@ void W_Rifle_BulletHail(.entity weaponentity, float mode, void() AttackFunc, WFR METHOD(Rifle, wr_aim, void(entity thiswep)) { + SELFPARAM(); PHYS_INPUT_BUTTON_ATCK(self) = false; PHYS_INPUT_BUTTON_ATCK2(self) = false; if(vdist(self.origin - self.enemy.origin, >, 1000)) @@ -198,22 +199,26 @@ METHOD(Rifle, wr_think, void(entity thiswep, entity actor, .entity weaponentity, } METHOD(Rifle, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(rifle, ammo); ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_PRI(rifle, ammo); return ammo_amount; } METHOD(Rifle, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(rifle, ammo); ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo); return ammo_amount; } METHOD(Rifle, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime); } METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND_RELOAD); } METHOD(Rifle, wr_suicidemessage, Notification(entity thiswep)) @@ -243,6 +248,7 @@ METHOD(Rifle, wr_killmessage, Notification(entity thiswep)) METHOD(Rifle, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 2; pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1); diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 8213da020..d13b38118 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -600,6 +600,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) METHOD(Seeker, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(WEP_CVAR(seeker, type) == 1) if(W_Seeker_Tagged_Info(self, self.enemy) != world) PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false); @@ -654,6 +655,7 @@ METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity } METHOD(Seeker, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount; if(WEP_CVAR(seeker, type) == 1) { @@ -669,6 +671,7 @@ METHOD(Seeker, wr_checkammo1, bool(entity thiswep)) } METHOD(Seeker, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount; if(WEP_CVAR(seeker, type) == 1) { @@ -684,6 +687,7 @@ METHOD(Seeker, wr_checkammo2, bool(entity thiswep)) } METHOD(Seeker, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND_RELOAD); } METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep)) @@ -703,6 +707,7 @@ METHOD(Seeker, wr_killmessage, Notification(entity thiswep)) METHOD(Seeker, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2; org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_BOUNCE) diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index fa1b822dd..9d47930ee 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -673,6 +673,7 @@ void W_Shockwave_Attack() METHOD(Shockwave, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range)) { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); } else diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 6c1042828..6cb0d0a74 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -228,6 +228,7 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity METHOD(Shotgun, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range))) PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); else @@ -281,16 +282,19 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit } METHOD(Shotgun, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.ammo_field = ammo_none; } METHOD(Shotgun, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(shotgun, ammo); ammo_amount += self.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_PRI(shotgun, ammo); return ammo_amount; } METHOD(Shotgun, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); if(IS_BOT_CLIENT(self)) if(vdist(self.origin - self.enemy.origin, >, WEP_CVAR_SEC(shotgun, melee_range))) return false; // bots cannot use secondary out of range (fixes constant melee when out of ammo) @@ -308,6 +312,7 @@ METHOD(Shotgun, wr_checkammo2, bool(entity thiswep)) } METHOD(Shotgun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND_RELOAD); // WEAPONTODO } METHOD(Shotgun, wr_suicidemessage, Notification(entity thiswep)) @@ -328,6 +333,7 @@ METHOD(Shotgun, wr_killmessage, Notification(entity thiswep)) METHOD(Shotgun, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2 = w_org + w_backoff * 2; pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent && time - self.prevric > 0.25) diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index cdb233296..4cb5ded98 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -588,7 +588,7 @@ void Ent_TubaNote_StopSound(entity this) this.enemy = NULL; } -void Ent_TubaNote_StopSound_self() { Ent_TubaNote_StopSound(self); } +void Ent_TubaNote_StopSound_self() { SELFPARAM(); Ent_TubaNote_StopSound(self); } NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew) { diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 13a929949..3d3e89618 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -341,6 +341,7 @@ void W_RocketMinsta_Attack3 () METHOD(Vaporizer, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(self.(thiswep.ammo_field) > 0) PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 1, false); else @@ -422,11 +423,13 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent } METHOD(Vaporizer, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.ammo_field = (thiswep.ammo_field); self.vaporizer_lasthit = 0; } METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); float ammo_amount = self.(thiswep.ammo_field) >= vaporizer_ammo; ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo; @@ -434,6 +437,7 @@ METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep)) } METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); if(!WEP_CVAR_SEC(vaporizer, ammo)) return true; float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(vaporizer, ammo); @@ -442,10 +446,12 @@ METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep)) } METHOD(Vaporizer, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); self.vaporizer_lasthit = 0; } METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); float used_ammo; if(WEP_CVAR_SEC(vaporizer, ammo)) @@ -469,6 +475,7 @@ METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep)) METHOD(Vaporizer, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index cdf75b1df..fdb89d77a 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -212,6 +212,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) METHOD(Vortex, wr_aim, void(entity thiswep)) { + SELFPARAM(); if(bot_aim(1000000, 0, 1, false)) PHYS_INPUT_BUTTON_ATCK(self) = true; else @@ -322,16 +323,19 @@ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity } METHOD(Vortex, wr_setup, void(entity thiswep)) { + SELFPARAM(); self.vortex_lasthit = 0; } METHOD(Vortex, wr_checkammo1, bool(entity thiswep)) { + SELFPARAM(); float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(vortex, ammo); ammo_amount += (autocvar_g_balance_vortex_reload_ammo && self.(weapon_load[WEP_VORTEX.m_id]) >= WEP_CVAR_PRI(vortex, ammo)); return ammo_amount; } METHOD(Vortex, wr_checkammo2, bool(entity thiswep)) { + SELFPARAM(); if(WEP_CVAR(vortex, secondary)) { // don't allow charging if we don't have enough ammo @@ -346,6 +350,7 @@ METHOD(Vortex, wr_checkammo2, bool(entity thiswep)) } METHOD(Vortex, wr_resetplayer, void(entity thiswep)) { + SELFPARAM(); if (WEP_CVAR(vortex, charge)) { if (WEP_CVAR_SEC(vortex, chargepool)) { self.vortex_chargepool_ammo = 1; @@ -356,6 +361,7 @@ METHOD(Vortex, wr_resetplayer, void(entity thiswep)) } METHOD(Vortex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { + SELFPARAM(); W_Reload(self, min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND_RELOAD); } METHOD(Vortex, wr_suicidemessage, Notification(entity thiswep)) @@ -372,6 +378,7 @@ METHOD(Vortex, wr_killmessage, Notification(entity thiswep)) METHOD(Vortex, wr_impacteffect, void(entity thiswep)) { + SELFPARAM(); vector org2 = w_org + w_backoff * 6; pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1); if(!w_issilent) diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc index 3f9dea125..60ad7252f 100644 --- a/qcsrc/lib/csqcmodel/sv_model.qc +++ b/qcsrc/lib/csqcmodel/sv_model.qc @@ -32,6 +32,7 @@ bool CSQCModel_Send(entity to, int sf) { + SELFPARAM(); // some nice flags for CSQCMODEL_IF float isplayer = (IS_CLIENT(self)); float islocalplayer = (self == to); diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index b364ced54..47d6af718 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -101,7 +101,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } /** return false to remove from the client */ .bool(entity this, entity to, int sendflags) SendEntity3; - bool SendEntity_self(entity to, int sendflags) { return self.SendEntity3(self, to, sendflags); } + bool SendEntity_self(entity to, int sendflags) { SELFPARAM(); return this.SendEntity3(this, to, sendflags); } void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc) { @@ -145,6 +145,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } void UncustomizeEntitiesRun() { + SELFPARAM(); FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITH(entity, self, it, it.uncustomizeentityforclient())); } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index c13d37260..d3b0e098d 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -637,6 +637,7 @@ bool ClientInit_SendEntity(entity this, entity to, int sf) } void ClientInit_misc() { + SELFPARAM(); int channel = MSG_ONE; WriteHeader(channel, ENT_CLIENT_INIT); WriteByte(channel, g_nexball_meter_period * 32); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 9570f359c..295883583 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -553,6 +553,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo void Unfreeze (entity targ) { + SELFPARAM(); if(!STAT(FROZEN, targ)) return; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6398cbe93..f1154e1b5 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1504,6 +1504,7 @@ only called if a time or frag limit has expired */ void NextLevel() { + SELFPARAM(); gameover = true; intermission_running = 1; diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index e9c31f326..9baa24a40 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -301,6 +301,7 @@ void assault_new_round() // they win. Otherwise the defending team wins once the timelimit passes. int WinningCondition_Assault() { + SELFPARAM(); WinningConditionHelper(); // set worldstatus int status = WINNING_NO; @@ -678,6 +679,7 @@ MUTATOR_HOOKFUNCTION(as, ReadLevelCvars) MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn) { + SELFPARAM(); switch(self.classname) { case "info_player_team1": diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index c90f7d178..7f2bd4234 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -242,6 +242,7 @@ MUTATOR_HOOKFUNCTION(ca, PutClientInServer) MUTATOR_HOOKFUNCTION(ca, reset_map_players) { + SELFPARAM(); FOREACH_CLIENT(true, { it.killcount = 0; if (!it.caplayer && IS_BOT_CLIENT(it)) diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 8cdad3255..fc2bf49d8 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -2353,6 +2353,7 @@ bool superspec_Spectate(entity _player); // TODO void superspec_msg(string _center_title, string _con_title, entity _to, string _msg, float _spamlevel); // TODO MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand) { + SELFPARAM(); if(IS_PLAYER(self) || MUTATOR_RETURNVALUE || !cvar("g_superspectate")) { return false; } if(cmd_name == "followfc") diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index 75c8b5dfe..256e7d73e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -388,6 +388,7 @@ MUTATOR_HOOKFUNCTION(cts, GetRecords) void ClientKill_Now(); MUTATOR_HOOKFUNCTION(cts, ClientKill) { + SELFPARAM(); ret_float = 0; if(self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index a451cf88a..4d7b8c9f9 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -378,6 +378,7 @@ MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver) MUTATOR_HOOKFUNCTION(ft, PlayerDies) { + SELFPARAM(); if(round_handler_IsActive()) if(round_handler_CountdownRunning()) { diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 8e0bcd8ee..34ed909b6 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -1353,6 +1353,7 @@ MUTATOR_HOOKFUNCTION(kh, PlayerUseKey) MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole) { + SELFPARAM(); if(IS_DEAD(self)) return true; diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index 40e9f6132..cb5760633 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -346,6 +346,7 @@ MUTATOR_HOOKFUNCTION(lms, Bot_FixCount, CBC_ORDER_EXCLUSIVE) MUTATOR_HOOKFUNCTION(lms, ClientCommand_Spectate) { + SELFPARAM(); if(self.lms_spectate_warning) { // for the forfeit message... diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index b7c994598..b09657e6a 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -387,6 +387,7 @@ float PlayerScore_Compare(entity t1, entity t2, float strict) void WinningConditionHelper() { + SELFPARAM(); float c; string s; float fullstatus; diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 0692d9088..d2c632294 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -49,6 +49,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf) .vector spawnpoint_prevorigin; void spawnpoint_think() { + SELFPARAM(); self.nextthink = time + 0.1; if(self.origin != self.spawnpoint_prevorigin) { diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index eeeb3c916..0d729fd6b 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -42,6 +42,7 @@ void Weapon_whereis(Weapon this, entity cl) bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain) { + SELFPARAM(); float f = 0; if (time < cl.hasweapon_complain_spam) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index ad3189918..999688b46 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -210,6 +210,7 @@ void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire) .float prevwarntime; bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary) { + SELFPARAM(); if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true; bool ammo = false; if (secondary) WITH(entity, self, actor, ammo = thiswep.wr_checkammo2(thiswep)); @@ -765,6 +766,7 @@ void W_Reload(entity actor, float sent_ammo_min, Sound sent_sound) void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item) { + SELFPARAM(); Weapon w = Weapons_from(weapon_type); weapon_dropevent_item = weapon_item; WITH(entity, self, player, w.event(w)); -- 2.39.2