]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove SELFPARAM() from .think and .touch 322/head
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 24 May 2016 12:01:49 +0000 (22:01 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 24 May 2016 12:01:49 +0000 (22:01 +1000)
162 files changed:
qcsrc/client/announcer.qc
qcsrc/client/main.qc
qcsrc/client/shownames.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/ent_cs.qc
qcsrc/common/ent_cs.qh
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/snake.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_monsters.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/mutators/mutator/sandbox/sandbox.qc
qcsrc/common/mutators/mutator/superspec/superspec.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/common/notifications/all.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/physics/movetypes/push.qc
qcsrc/common/sounds/sound.qh
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh
qcsrc/common/triggers/func/bobbing.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/fourier.qc
qcsrc/common/triggers/func/ladder.qc
qcsrc/common/triggers/func/pendulum.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/func/rotating.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/platforms.qh
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/subs.qh
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/music.qh
qcsrc/common/triggers/teleporters.qh
qcsrc/common/triggers/trigger/gravity.qc
qcsrc/common/triggers/trigger/heal.qc
qcsrc/common/triggers/trigger/hurt.qc
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/jumppads.qh
qcsrc/common/triggers/trigger/keylock.qc
qcsrc/common/triggers/trigger/monoflop.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/multivibrator.qc
qcsrc/common/triggers/trigger/secret.qc
qcsrc/common/triggers/trigger/swamp.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/sv_turrets.qh
qcsrc/common/turrets/targettrigger.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/lib/defer.qh
qcsrc/lib/net.qh
qcsrc/lib/self.qh
qcsrc/lib/warpzone/client.qc
qcsrc/lib/warpzone/common.qc
qcsrc/lib/warpzone/server.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/bot/waypoints.qh
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_player.qh
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qh
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qh
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/path_waypoint.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/round_handler.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/t_quake3.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/common.qh
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/throwing.qh
qcsrc/server/weapons/weaponsystem.qc

index 656349a0f63688478f99f2a9cb5220cf44c478ec..e5fd7d575f643a7e9c7f940c62f8eec94c2b82a5 100644 (file)
@@ -17,9 +17,8 @@ string AnnouncerOption()
 
 entity announcer_countdown;
 
-void Announcer_Countdown()
+void Announcer_Countdown(entity this)
 {
-       SELFPARAM();
        float starttime = STAT(GAMESTARTTIME);
        float roundstarttime = STAT(ROUNDSTARTTIME);
        if(roundstarttime == -1)
index 1767b8f2bd76c48d95deb6e4a67c885dcbd4faa3..2baa971b90ca854e65d6ed5298da0b6af6c7f28e 100644 (file)
@@ -290,9 +290,8 @@ float SetTeam(entity o, int Team)
        return false;
 }
 
-void Playerchecker_Think()
+void Playerchecker_Think(entity this)
 {
-       SELFPARAM();
     int i;
        entity e;
        for(i = 0; i < maxclients; ++i)
index 79acf4fb8a38386e0344b1d55e1219ec9df1261e..e9db990c82d474a07e06ee358dd9f0a99313ece1 100644 (file)
@@ -177,7 +177,7 @@ void Draw_ShowNames_All()
                }
                make_impure(it);
                assert(getthink(entcs), eprint(entcs));
-               WITHSELF(entcs, getthink(entcs)());
+               WITHSELF(entcs, getthink(entcs)(entcs));
                if (!entcs.has_origin) continue;
                if (entcs.m_entcs_private)
                {
index 8763ba2379b99817ef5702ff9be0fe744ccd7d70..6261fa842f987773298274395246d7a32f782739 100644 (file)
@@ -22,12 +22,6 @@ void SUB_Stop(entity this)
        this.move_movetype = MOVETYPE_NONE;
 }
 
-void SUB_Stop_self()
-{
-       SELFPARAM();
-       SUB_Stop(this);
-}
-
 void Projectile_ResetTrail(entity this, vector to)
 {
        this.trail_oldorigin = to;
@@ -337,7 +331,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                this.mins = '0 0 0';
                this.maxs = '0 0 0';
                this.colormod = '0 0 0';
-               settouch(this, SUB_Stop_self);
+               settouch(this, SUB_Stop);
                this.move_movetype = MOVETYPE_TOSS;
                this.alphamod = 1;
 
index bb954e2eb17640aea3b75c035276c3af1cc16367..8cb4a2aa18ff6dcfff9065b62ad01c2b656919af 100644 (file)
@@ -83,8 +83,8 @@ Sound SND_CASINGS_RANDOM() {
     return Sounds_from(SND_CASINGS1.m_id + floor(prandom() * 3));
 }
 
-void Casing_Touch()
-{SELFPARAM();
+void Casing_Touch(entity this)
+{
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
     {
         Casing_Delete(self);
index c8afaf99068a6886f668d2c55b15b6c25bd83001..3d67392899d9dceeeaa5ef7c18d8b21397831ff4 100644 (file)
@@ -69,8 +69,8 @@ void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad
 .int state;
 .bool isplayermodel;
 
-void DamageEffect_Think()
-{SELFPARAM();
+void DamageEffect_Think(entity this)
+{
        // if particle distribution is enabled, slow ticrate by total number of damages
        if(autocvar_cl_damageeffect_distribute)
                this.nextthink = time + autocvar_cl_damageeffect_ticrate * this.owner.total_damages;
index eaf725048990991e6416e11cf2bd0490b611f086..20b050c3a4a633ea225e8e7a2e0f523ce17991f1 100644 (file)
@@ -111,15 +111,14 @@ void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany)
                __pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
 }
 
-void SUB_RemoveOnNoImpact()
+void SUB_RemoveOnNoImpact(entity this)
 {
-    SELFPARAM();
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
                Gib_Delete(self);
 }
 
-void Gib_Touch()
-{SELFPARAM();
+void Gib_Touch(entity this)
+{
        // TODO maybe bounce of walls, make more gibs, etc.
 
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
index 64ddc4473586143bca0a9925103bbb0ec6c9f036..75deb92eaf8a5c448a69c7754ade78af4b82cfd7 100644 (file)
@@ -83,9 +83,8 @@
                return _entcs_send(this, to, sf, MSG_ENTITY);
        }
 
-       void entcs_think()
+       void entcs_think(entity this)
        {
-               SELFPARAM();
                this.nextthink = time + 0.033333333333;  // TODO: increase this to like 0.15 once the client can do smoothing
                entity o = this.owner;
                int i = 1;
                if (e != this) remove(e);
        }
 
-       void entcs_think()
+       void entcs_think(entity this)
        {
-               SELFPARAM();
                entity e = CSQCModel_server2csqc(this.sv_entnum);
                if (e == NULL)
                {
        #undef X
                this.iflags |= IFLAG_ORIGIN;
                InterpolateOrigin_Note(this);
-               WITHSELF(this, getthink(this)());
+               WITHSELF(this, getthink(this)(this));
                return true;
        }
 
index 0d02e4b538e3f789981118358500052609b3399e..1c72b351f7ff7e4e65b48fd9e5bf599f86c11a40 100644 (file)
@@ -26,7 +26,7 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
 
        bool entcs_send(entity this, entity to, int sf);
 
-       void entcs_think();
+       void entcs_think(entity this);
 
        void entcs_attach(entity e);
 
index 1ce1af8c8283fa2a442cd789f0413cd26c034d0c..5063071d63ace47cd77430936fb6b024bc2f8f7f 100644 (file)
@@ -40,9 +40,9 @@ float autocvar_g_balance_nexball_secondary_lifetime;
 float autocvar_g_balance_nexball_secondary_refire;
 float autocvar_g_balance_nexball_secondary_speed;
 
-void basketball_touch();
-void football_touch();
-void ResetBall();
+void basketball_touch(entity this);
+void football_touch(entity this);
+void ResetBall(entity this);
 const int NBM_NONE = 0;
 const int NBM_FOOTBALL = 2;
 const int NBM_BASKETBALL = 4;
@@ -84,7 +84,7 @@ void ball_restart(entity this)
 {
        if(this.owner)
                DropBall(this, this.owner.origin, '0 0 0');
-       ResetBall();
+       ResetBall(this);
 }
 
 void nexball_setstatus()
@@ -96,7 +96,8 @@ void nexball_setstatus()
                {
                        bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
                        DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0');
-                       WITHSELF(this.ballcarried, ResetBall());
+                       entity e = this.ballcarried;
+                       WITHSELF(e, ResetBall(e));
                }
                else
                        this.items |= IT_KEY1;
@@ -120,8 +121,8 @@ void relocate_nexball(entity this)
        }
 }
 
-void DropOwner()
-{SELFPARAM();
+void DropOwner(entity this)
+{
        entity ownr;
        ownr = this.owner;
        DropBall(this, ownr.origin, ownr.velocity);
@@ -220,8 +221,8 @@ void DropBall(entity ball, vector org, vector vel)
        ball.owner = world;
 }
 
-void InitBall()
-{SELFPARAM();
+void InitBall(entity this)
+{
        if(gameover) return;
        UNSET_ONGROUND(this);
        this.movetype = MOVETYPE_BOUNCE;
@@ -240,8 +241,8 @@ void InitBall()
        LogNB("init", world);
 }
 
-void ResetBall()
-{SELFPARAM();
+void ResetBall(entity this)
+{
        if(this.cnt < 2)        // step 1
        {
                if(time == this.teamtime)
@@ -276,8 +277,8 @@ void ResetBall()
        }
 }
 
-void football_touch()
-{SELFPARAM();
+void football_touch(entity this)
+{
        if(other.solid == SOLID_BSP)
        {
                if(time > self.lastground + 0.1)
@@ -322,11 +323,11 @@ void football_touch()
        self.avelocity = -250 * v_forward;  // maybe there is a way to make it look better?
 }
 
-void basketball_touch()
-{SELFPARAM();
+void basketball_touch(entity this)
+{
        if(other.ballcarried)
        {
-               football_touch();
+               football_touch(this);
                return;
        }
        if(!self.cnt && IS_PLAYER(other) && !STAT(FROZEN, other) && !IS_DEAD(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
@@ -344,8 +345,8 @@ void basketball_touch()
        }
 }
 
-void GoalTouch()
-{SELFPARAM();
+void GoalTouch(entity this)
+{
        entity ball;
        float isclient, pscore, otherteam;
        string pname;
@@ -702,8 +703,8 @@ spawnfunc(ball_bound)
 //=======================//
 
 
-void W_Nexball_Think()
-{SELFPARAM();
+void W_Nexball_Think(entity this)
+{
        //dprint("W_Nexball_Think\n");
        //vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
        vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
@@ -717,8 +718,8 @@ void W_Nexball_Think()
        this.nextthink = time;
 }
 
-void W_Nexball_Touch()
-{SELFPARAM();
+void W_Nexball_Touch(entity this)
+{
        entity ball, attacker;
        attacker = self.owner;
        //self.think = func_null;
@@ -816,7 +817,7 @@ void W_Nexball_Attack2()
        W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
        missile.angles = vectoangles(missile.velocity);
        settouch(missile, W_Nexball_Touch);
-       setthink(missile, SUB_Remove_self);
+       setthink(missile, SUB_Remove);
        missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
 
        missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
index 38799f2cea4387a4e9533927a804e86351c5db7a..0870ed6bfa323b0811b504b9d7db39330c9fd19a 100644 (file)
@@ -172,8 +172,8 @@ bool ons_CaptureShield_Customize()
        return true;
 }
 
-void ons_CaptureShield_Touch()
-{SELFPARAM();
+void ons_CaptureShield_Touch(entity this)
+{
        if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, other.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return; }
        if(!IS_PLAYER(other)) { return; }
        if(SAME_TEAM(other, self)) { return; }
@@ -395,8 +395,8 @@ bool ons_Link_Send(entity this, entity to, int sendflags)
        return true;
 }
 
-void ons_Link_CheckUpdate()
-{SELFPARAM();
+void ons_Link_CheckUpdate(entity this)
+{
        // TODO check if the two sides have moved (currently they won't move anyway)
        float cc = 0, cc1 = 0, cc2 = 0;
 
@@ -559,8 +559,8 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
        this.SendFlags |= CPSF_STATUS;
 }
 
-void ons_ControlPoint_Icon_Think()
-{SELFPARAM();
+void ons_ControlPoint_Icon_Think(entity this)
+{
        this.nextthink = time + ONS_CP_THINKRATE;
 
        if(autocvar_g_onslaught_cp_proxydecap)
@@ -627,8 +627,8 @@ void ons_ControlPoint_Icon_Think()
        }
 }
 
-void ons_ControlPoint_Icon_BuildThink()
-{SELFPARAM();
+void ons_ControlPoint_Icon_BuildThink(entity this)
+{
        int a;
 
        this.nextthink = time + ONS_CP_THINKRATE;
@@ -681,7 +681,7 @@ void ons_ControlPoint_Icon_BuildThink()
                Send_Effect(EFFECT_RAGE, this.origin + 10 * randomvec(), '0 0 -1', 1);
 }
 
-void onslaught_controlpoint_icon_link(entity e, void() spawnproc);
+void onslaught_controlpoint_icon_link(entity e, void(entity this) spawnproc);
 
 void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
 {
@@ -776,8 +776,8 @@ void ons_ControlPoint_UpdateSprite(entity e)
        }
 }
 
-void ons_ControlPoint_Touch()
-{SELFPARAM();
+void ons_ControlPoint_Touch(entity this)
+{
        entity toucher = other;
        int attackable;
 
@@ -813,8 +813,8 @@ void ons_ControlPoint_Touch()
        onslaught_updatelinks();
 }
 
-void ons_ControlPoint_Think()
-{SELFPARAM();
+void ons_ControlPoint_Think(entity this)
+{
        self.nextthink = time + ONS_CP_THINKRATE;
        CSQCMODEL_AUTOUPDATE(self);
 }
@@ -1021,8 +1021,8 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d
        this.SendFlags |= GSF_STATUS;
 }
 
-void ons_GeneratorThink()
-{SELFPARAM();
+void ons_GeneratorThink(entity this)
+{
        this.nextthink = time + GEN_THINKRATE;
        if (!gameover)
        {
@@ -1083,8 +1083,8 @@ void ons_DelayedGeneratorSetup(entity this)
 }
 
 
-void onslaught_generator_touch()
-{SELFPARAM();
+void onslaught_generator_touch(entity this)
+{
        if ( IS_PLAYER(other) )
        if ( SAME_TEAM(self,other) )
        if ( self.iscaptured )
@@ -2156,7 +2156,7 @@ MUTATOR_HOOKFUNCTION(ons, TurretThink)
        }
 
        if(self.team != self.tur_head.team)
-               turret_respawn();
+               turret_respawn(self);
 
        return false;
 }
index be46b285b4357ce2047e24d184a4d26312bce99a..aceb3e64eacf9f504a2002d1b47dbde0dbb147cc 100644 (file)
@@ -32,7 +32,7 @@ bool cpicon_send(entity this, entity to, int sf)
        return true;
 }
 
-void onslaught_controlpoint_icon_link(entity e, void() spawnproc)
+void onslaught_controlpoint_icon_link(entity e, void(entity this) spawnproc)
 {
        Net_LinkEntity(e, true, 0, cpicon_send);
        setthink(e, spawnproc);
index f0255456fceab1c2908f9a5d072f37a0346e02ef..aeac4e1626d88fa2af7b87cc3bc8611fb59f21cd 100644 (file)
@@ -29,7 +29,7 @@ bool generator_send(entity this, entity to, int sf)
        return true;
 }
 
-void generator_link(void() spawnproc)
+void generator_link(void(entity this) spawnproc)
 {SELFPARAM();
        Net_LinkEntity(self, true, 0, generator_send);
        setthink(self, spawnproc);
index 14998989724a728bdb91cdf2959f29f0608121a7..4bcb8c51446ee77020731131ee95bc2e9bc7ef9e 100644 (file)
@@ -36,7 +36,7 @@ float autocvar_sv_minigames_pong_ball_number;
 float autocvar_sv_minigames_pong_ai_thinkspeed;
 float autocvar_sv_minigames_pong_ai_tolerance;
 
-void pong_ball_think();
+void pong_ball_think(entity this);
 
 // Throws a ball in a random direction and sets the think function
 void pong_ball_throw(entity ball)
@@ -54,8 +54,8 @@ void pong_ball_throw(entity ball)
 }
 
 // Think equivalent of pong_ball_throw, used to delay throws
-void pong_ball_throwthink()
-{SELFPARAM();
+void pong_ball_throwthink(entity this)
+{
        pong_ball_throw(self);
 }
 
@@ -145,8 +145,8 @@ bool pong_goal(entity ball, int pteam)
 }
 
 // Moves the ball around
-void pong_ball_think()
-{SELFPARAM();
+void pong_ball_think(entity this)
+{
        float think_speed = autocvar_sys_ticrate;
        this.nextthink = time + think_speed;
 
@@ -201,8 +201,8 @@ void pong_ball_think()
 }
 
 // AI action
-void pong_ai_think()
-{SELFPARAM();
+void pong_ai_think(entity this)
+{
        float think_speed = autocvar_sv_minigames_pong_ai_thinkspeed;
        this.nextthink = time + think_speed;
 
@@ -266,8 +266,8 @@ entity pong_ai_spawn(entity paddle)
 }
 
 // Moves the paddle
-void pong_paddle_think()
-{SELFPARAM();
+void pong_paddle_think(entity this)
+{
        float think_speed = autocvar_sys_ticrate;
        this.nextthink = time + think_speed;
 
index 95fda671a19f3dec5ceb9cacc38a3871d8c38ec9..98729092ccd2894c10a172c687439fc69c521457 100644 (file)
@@ -153,9 +153,8 @@ void snake_check_winner(entity minigame)
 }
 
 void snake_move_head(entity minigame, entity head);
-void snake_head_think()
+void snake_head_think(entity this)
 {
-    SELFPARAM();
        entity minigame = this.owner;
 
        if(minigame.minigame_flags & SNAKE_TURN_MOVE)
index 0f3ea814c5468517b20b2b43bba638c273c79dac..50e9061308849f325382fdd41fa944a14d35e8f4 100644 (file)
@@ -160,9 +160,8 @@ void M_Mage_Attack_Spike_Explode(entity this)
        remove (this);
 }
 
-void M_Mage_Attack_Spike_Touch()
+void M_Mage_Attack_Spike_Touch(entity this)
 {
-    SELFPARAM();
        PROJECTILE_TOUCH;
 
        M_Mage_Attack_Spike_Explode(self);
@@ -171,8 +170,8 @@ void M_Mage_Attack_Spike_Touch()
 .float wait;
 
 // copied from W_Seeker_Think
-void M_Mage_Attack_Spike_Think()
-{SELFPARAM();
+void M_Mage_Attack_Spike_Think(entity this)
+{
        if (time > this.ltime || (this.enemy && this.enemy.health <= 0) || this.owner.health <= 0) {
                this.projectiledeathtype |= HITTYPE_SPLASH;
                M_Mage_Attack_Spike_Explode(this);
index 751d0fff01ff822e72e81baba4ed49c5b449e0b2..c2e13883c6fe34ebe145ab1d402aa88f8205fe96 100644 (file)
@@ -101,7 +101,7 @@ void M_Shambler_Attack_Lightning_Explode(entity this)
                Damage(head, this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(this), DEATH_MONSTER_SHAMBLER_ZAP.m_id, head.origin, '0 0 0');
        }
 
-       setthink(this, SUB_Remove_self);
+       setthink(this, SUB_Remove);
        this.nextthink = time + 0.2;
 }
 
@@ -124,15 +124,15 @@ void M_Shambler_Attack_Lightning_Damage(entity this, entity inflictor, entity at
                W_PrepareExplosionByDamage(this, attacker, adaptor_think2use);
 }
 
-void M_Shambler_Attack_Lightning_Touch()
-{SELFPARAM();
+void M_Shambler_Attack_Lightning_Touch(entity this)
+{
        PROJECTILE_TOUCH;
 
        self.use(this, NULL, NULL);
 }
 
-void M_Shambler_Attack_Lightning_Think()
-{SELFPARAM();
+void M_Shambler_Attack_Lightning_Think(entity this)
+{
        this.nextthink = time;
        if (time > this.cnt)
        {
index 264512069a33b015262b4c7da545777bdf8adf10..281accb14444ce77dc5521e04a6c9207713d58a5 100644 (file)
@@ -156,14 +156,14 @@ void M_Spider_Attack_Web_Explode_use(entity this, entity actor, entity trigger)
        WITHSELF(this, M_Spider_Attack_Web_Explode());
 }
 
-void M_Spider_Attack_Web_Touch()
+void M_Spider_Attack_Web_Touch(entity this)
 {
        PROJECTILE_TOUCH;
 
        M_Spider_Attack_Web_Explode();
 }
 
-void adaptor_think2use_hittype_splash();
+void adaptor_think2use_hittype_splash(entity this);
 
 void M_Spider_Attack_Web(entity this)
 {
index 87cc5d73f8098fd647a28274a9f822e1c880412a..a0e670507013ceddb3713db56d4038fad824aaac 100644 (file)
@@ -45,8 +45,8 @@ float autocvar_g_monster_wyvern_attack_fireball_force;
 float autocvar_g_monster_wyvern_attack_fireball_radius;
 float autocvar_g_monster_wyvern_attack_fireball_speed;
 
-void M_Wyvern_Attack_Fireball_Explode();
-void M_Wyvern_Attack_Fireball_Touch();
+void M_Wyvern_Attack_Fireball_Explode(entity this);
+void M_Wyvern_Attack_Fireball_Touch(entity this);
 
 SOUND(WyvernAttack_FIRE, W_Sound("electro_fire"));
 METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity weaponentity, int fire))
@@ -99,9 +99,8 @@ const float wyvern_anim_pain  = 3;
 const float wyvern_anim_death  = 4;
 */
 
-void M_Wyvern_Attack_Fireball_Explode()
+void M_Wyvern_Attack_Fireball_Explode(entity this)
 {
-       SELFPARAM();
        Send_Effect(EFFECT_FIREBALL_EXPLODE, this.origin, '0 0 0', 1);
 
        entity own = this.realowner;
@@ -117,11 +116,11 @@ void M_Wyvern_Attack_Fireball_Explode()
        remove(this);
 }
 
-void M_Wyvern_Attack_Fireball_Touch()
+void M_Wyvern_Attack_Fireball_Touch(entity this)
 {
        PROJECTILE_TOUCH;
 
-       M_Wyvern_Attack_Fireball_Explode();
+       M_Wyvern_Attack_Fireball_Explode(this);
 }
 
 bool M_Wyvern_Attack(int attack_type, entity actor, entity targ)
index ffbb06c26258c4f0d3b28d073b6378a81c2a3ef7..ec84bb948f21e8503bf1ea321cbbc03699479d9b 100644 (file)
@@ -75,8 +75,8 @@ const float zombie_anim_spawn                         = 30;
 
 .vector moveto;
 
-void M_Zombie_Attack_Leap_Touch()
-{SELFPARAM();
+void M_Zombie_Attack_Leap_Touch(entity this)
+{
        if (self.health <= 0)
                return;
 
index f1a0576c7374424ddc52a7fb4dd1f42e3d51c2e0..2e7281bc2c2d1f9b08bdccb6005da9c9b228a923 100644 (file)
@@ -191,7 +191,6 @@ void monster_changeteam(entity ent, float newteam)
 }
 
 .void(entity) monster_delayedfunc;
-void Monster_Delay_Action_self();
 void Monster_Delay_Action(entity this)
 {
        if(Monster_ValidTarget(this.owner, this.owner.enemy)) { this.monster_delayedfunc(this.owner); }
@@ -199,28 +198,22 @@ void Monster_Delay_Action(entity this)
        if(this.cnt > 1)
        {
                this.cnt -= 1;
-               setthink(this, Monster_Delay_Action_self);
+               setthink(this, Monster_Delay_Action);
                this.nextthink = time + this.count;
        }
        else
        {
-               setthink(this, SUB_Remove_self);
+               setthink(this, SUB_Remove);
                this.nextthink = time;
        }
 }
 
-void Monster_Delay_Action_self()
-{
-    SELFPARAM();
-       Monster_Delay_Action(this);
-}
-
 void Monster_Delay(entity this, int repeat_count, float defer_amnt, void(entity) func)
 {
        // deferred attacking, checks if monster is still alive and target is still valid before attacking
        entity e = spawn();
 
-       setthink(e, Monster_Delay_Action_self);
+       setthink(e, Monster_Delay_Action);
        e.nextthink = time + defer_amnt;
        e.count = defer_amnt;
        e.owner = this;
@@ -401,7 +394,7 @@ bool Monster_Attack_Leap_Check(entity this, vector vel)
        return true;
 }
 
-bool Monster_Attack_Leap(entity this, vector anm, void() touchfunc, vector vel, float animtime)
+bool Monster_Attack_Leap(entity this, vector anm, void(entity this) touchfunc, vector vel, float animtime)
 {
        if(!Monster_Attack_Leap_Check(this, vel))
                return false;
@@ -473,8 +466,8 @@ void Monster_UpdateModel(entity this)
        mon.mr_anim(mon, this);
 }
 
-void Monster_Touch()
-{SELFPARAM();
+void Monster_Touch(entity this)
+{
        if(other == world) { return; }
 
        if(other.monster_attack)
@@ -516,7 +509,7 @@ bool Monster_Respawn_Check(entity this)
        return true;
 }
 
-void Monster_Respawn() { SELFPARAM(); Monster_Spawn(this, this.monsterid); }
+void Monster_Respawn(entity this) { Monster_Spawn(this, this.monsterid); }
 
 void Monster_Dead_Fade(entity this)
 {
@@ -919,8 +912,8 @@ void Monster_Remove(entity this)
        remove(this);
 }
 
-void Monster_Dead_Think()
-{SELFPARAM();
+void Monster_Dead_Think(entity this)
+{
        this.nextthink = time + this.ticrate;
 
        if(this.monster_lifetime != 0)
@@ -980,7 +973,7 @@ void Monster_Dead_Damage(entity this, entity inflictor, entity attacker, float d
                // number of monsters spawned with mobspawn command
                totalspawned -= 1;
 
-               setthink(this, SUB_Remove_self);
+               setthink(this, SUB_Remove);
                this.nextthink = time + 0.1;
                this.event_damage = func_null;
        }
@@ -1115,7 +1108,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage
                {
                        Violence_GibSplash(this, 1, 0.5, attacker);
 
-                       setthink(this, SUB_Remove_self);
+                       setthink(this, SUB_Remove);
                        this.nextthink = time + 0.1;
                }
        }
@@ -1214,8 +1207,8 @@ void Monster_Anim(entity this)
        */
 }
 
-void Monster_Think()
-{SELFPARAM();
+void Monster_Think(entity this)
+{
        setthink(this, Monster_Think);
        this.nextthink = this.ticrate;
 
index 59d8cbd973f9b144d63f527881651499542d9581..f8501fc758e1b8184f67e9ff222beab022d647ac 100644 (file)
@@ -77,7 +77,7 @@ bool Monster_Spawn(entity this, int mon_id);
 
 void monster_setupcolors(entity this);
 
-void Monster_Touch();
+void Monster_Touch(entity this);
 
 void Monster_Move_2D(entity this, float mspeed, float allow_jumpoff);
 
@@ -85,7 +85,7 @@ void Monster_Delay(entity this, int repeat_count, float defer_amnt, void(entity)
 
 float Monster_Attack_Melee(entity this, entity targ, float damg, vector anim, float er, float animtime, int deathtype, float dostop);
 
-bool Monster_Attack_Leap(entity this, vector anm, void() touchfunc, vector vel, float animtime);
+bool Monster_Attack_Leap(entity this, vector anm, void(entity this) touchfunc, vector vel, float animtime);
 
 entity Monster_FindTarget(entity this);
 
index d0d206ab04e6278ac1760c8ce7ef9e07f306520f..c450dc5703d8ba2520a64518701b442c9737bb6a 100644 (file)
@@ -222,8 +222,8 @@ void buff_Respawn(entity this)
        sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 }
 
-void buff_Touch()
-{SELFPARAM();
+void buff_Touch(entity this)
+{
        if(gameover) { return; }
 
        if(ITEM_TOUCH_NEEDKILL())
@@ -298,8 +298,8 @@ void buff_NewType(entity ent, float cb)
        ent.buffs = RandomSelection_chosen_float;
 }
 
-void buff_Think()
-{SELFPARAM();
+void buff_Think(entity this)
+{
        if(this.buffs != this.oldbuffs)
        {
                entity buff = buff_FirstFromFlags(this.buffs);
@@ -474,8 +474,8 @@ void buff_SpawnReplacement(entity ent, entity old)
        buff_Init(ent);
 }
 
-void buff_Vengeance_DelayedDamage()
-{SELFPARAM();
+void buff_Vengeance_DelayedDamage(entity this)
+{
        if(this.enemy)
                Damage(this.enemy, this.owner, this.owner, this.dmg, DEATH_BUFF.m_id, this.enemy.origin, '0 0 0');
 
@@ -889,7 +889,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
                                {
                                        entity oldother = other;
                                        other = self;
-                                       WITHSELF(it, gettouch(it)());
+                                       WITHSELF(it, gettouch(it)(it));
                                        other = oldother;
                                }
                        }
index 8721cede77625d66443783cad5dd860a10ab0a69..fe33046678fa9fc1d46c47a3bd24132753b64a5a 100644 (file)
@@ -29,19 +29,19 @@ spawnfunc(item_minst_cells)
        StartItem(this, ITEM_VaporizerCells);
 }
 
-void instagib_invisibility()
-{SELFPARAM();
+void instagib_invisibility(entity this)
+{
        this.strength_finished = autocvar_g_balance_powerup_strength_time;
        StartItem(this, ITEM_Invisibility);
 }
 
-void instagib_extralife()
-{SELFPARAM();
+void instagib_extralife(entity this)
+{
        StartItem(this, ITEM_ExtraLife);
 }
 
-void instagib_speed()
-{SELFPARAM();
+void instagib_speed(entity this)
+{
        this.invincible_finished = autocvar_g_balance_powerup_invincible_time;
        StartItem(this, ITEM_Speed);
 }
index 39310c9fd7acaf017447731b5505406b8e9e03c0..a6a2f72284ceeaea49f50237af9c752083bcfcd6 100644 (file)
@@ -147,8 +147,8 @@ REGISTER_MUTATOR(nades, cvar("g_nades"));
 
 .entity nade_spawnloc;
 
-void nade_timer_think()
-{SELFPARAM();
+void nade_timer_think(entity this)
+{
        this.skin = 8 - (this.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10);
        this.nextthink = time;
        if(!this.owner || wasfreed(this.owner))
@@ -216,8 +216,8 @@ void napalm_damage(entity this, float dist, float damage, float edgedamage, floa
 }
 
 
-void napalm_ball_think()
-{SELFPARAM();
+void napalm_ball_think(entity this)
+{
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
        {
@@ -289,8 +289,8 @@ void nade_napalm_ball(entity this)
 }
 
 
-void napalm_fountain_think()
-{SELFPARAM();
+void napalm_fountain_think(entity this)
+{
 
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
@@ -363,8 +363,8 @@ void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time)
        Drop_Special_Items(frost_target);
 }
 
-void nade_ice_think()
-{SELFPARAM();
+void nade_ice_think(entity this)
+{
 
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
@@ -502,8 +502,8 @@ void nade_spawn_boom(entity this)
        this.realowner.nade_spawnloc = spawnloc;
 }
 
-void nade_heal_think()
-{SELFPARAM();
+void nade_heal_think(entity this)
+{
        if(time >= self.ltime)
        {
                remove(self);
@@ -521,8 +521,8 @@ void nade_heal_think()
                self.nade_show_particles = 0;
 }
 
-void nade_heal_touch()
-{SELFPARAM();
+void nade_heal_touch(entity this)
+{
        float maxhealth;
        float health_factor;
        if(IS_PLAYER(other) || IS_MONSTER(other))
@@ -598,8 +598,8 @@ void nade_monster_boom(entity this)
        e.monster_skill = MONSTER_SKILL_INSANE;
 }
 
-void nade_boom()
-{SELFPARAM();
+void nade_boom(entity this)
+{
        entity expef = NULL;
        bool nade_blast = true;
 
@@ -688,8 +688,8 @@ void nade_pickup(entity this, entity thenade)
 }
 
 bool CanThrowNade(entity this);
-void nade_touch()
-{SELFPARAM();
+void nade_touch(entity this)
+{
        if(other)
                UpdateCSQCProjectile(self);
 
@@ -735,11 +735,11 @@ void nade_touch()
        }
 
        self.enemy = other;
-       nade_boom();
+       nade_boom(self);
 }
 
-void nade_beep()
-{SELFPARAM();
+void nade_beep(entity this)
+{
        sound(this, CH_SHOTS_SINGLE, SND_NADE_BEEP, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
        setthink(this, nade_boom);
        this.nextthink = max(this.wait, time);
@@ -750,7 +750,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
        if(ITEM_DAMAGE_NEEDKILL(deathtype))
        {
                this.takedamage = DAMAGE_NO;
-               WITHSELF(this, nade_boom());
+               WITHSELF(this, nade_boom(this));
                return;
        }
 
@@ -981,7 +981,7 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
        fn.colormod = Nades_from(n.nade_type).m_color;
        fn.colormap = player.colormap;
        fn.glowmod = player.glowmod;
-       setthink(fn, SUB_Remove_self);
+       setthink(fn, SUB_Remove);
        fn.nextthink = n.wait;
 
        player.nade = n;
index 6f3c146a3fb8ef8da3f635de25a35e0b47310483..c670879e3788e9c8cceff9e3bff4a49614f15b4c 100644 (file)
@@ -267,8 +267,8 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
        return false;
 }
 
-void self_spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
-void self_spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
+void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }
+void self_spawnfunc_weapon_rpc(entity this) { spawnfunc_weapon_rpc(this); }
 
 MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
 {SELFPARAM();
index c11ebc8a396ae3dbe041faf7d9ef682108a70c81..860e37bccaeafe5f285bae6aff87ef457337162c 100644 (file)
@@ -50,8 +50,8 @@ REGISTER_WEAPON(RPC, rpc, NEW(RocketPropelledChainsaw));
 #ifdef SVQC
 spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(this, WEP_RPC); }
 
-void W_RocketPropelledChainsaw_Explode()
-{SELFPARAM();
+void W_RocketPropelledChainsaw_Explode(entity this)
+{
        self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
 
@@ -60,13 +60,13 @@ void W_RocketPropelledChainsaw_Explode()
        remove (self);
 }
 
-void W_RocketPropelledChainsaw_Touch ()
-{SELFPARAM();
+void W_RocketPropelledChainsaw_Touch (entity this)
+{
        if(WarpZone_Projectile_Touch())
                if(wasfreed(self))
                        return;
 
-       W_RocketPropelledChainsaw_Explode();
+       W_RocketPropelledChainsaw_Explode(this);
 }
 
 void W_RocketPropelledChainsaw_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -83,8 +83,8 @@ void W_RocketPropelledChainsaw_Damage(entity this, entity inflictor, entity atta
                W_PrepareExplosionByDamage(this, attacker, W_RocketPropelledChainsaw_Explode);
 }
 
-void W_RocketPropelledChainsaw_Think()
-{SELFPARAM();
+void W_RocketPropelledChainsaw_Think(entity this)
+{
        if(self.cnt <= time)
        {
                remove(self);
index c9ab81b4e42ebc8a85a3c11389261cc12e4641e7..3ef52fec5abe6647a32806ba5844a71d43825c3e 100644 (file)
@@ -31,8 +31,8 @@ REGISTER_MUTATOR(physical_items, cvar("g_physical_items"))
 
 .vector spawn_origin, spawn_angles;
 
-void physical_item_think()
-{SELFPARAM();
+void physical_item_think(entity this)
+{
        self.nextthink = time;
 
        self.alpha = self.owner.alpha; // apply fading and ghosting
@@ -68,8 +68,8 @@ void physical_item_think()
                remove(self); // the real item is gone, remove this
 }
 
-void physical_item_touch()
-{SELFPARAM();
+void physical_item_touch(entity this)
+{
        if(!self.cnt) // not for dropped items
        if (ITEM_TOUCH_NEEDKILL())
        {
index 9d592f27703bc4dcc1a4e5661a301e0bd70fb70f..b3e9ea15a94c1bd9bf3f39b2473694d577c42006 100644 (file)
@@ -46,8 +46,8 @@ float object_count;
 .string material;
 
 .float touch_timer;
-void sandbox_ObjectFunction_Touch()
-{SELFPARAM();
+void sandbox_ObjectFunction_Touch(entity this)
+{
        // apply material impact effects
 
        if(!self.material)
@@ -71,8 +71,8 @@ void sandbox_ObjectFunction_Touch()
        Send_Effect_(strcat("impact_", self.material), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
 }
 
-void sandbox_ObjectFunction_Think()
-{SELFPARAM();
+void sandbox_ObjectFunction_Think(entity this)
+{
        // decide if and how this object can be grabbed
        if(autocvar_g_sandbox_readonly)
                self.grab = 0; // no grabbing
index ae10cb5a401ab1a0a36478520330d4ae4c9ece2a..142f9d9ba54dce3d379993b0cbfc794336435896 100644 (file)
@@ -377,8 +377,8 @@ MUTATOR_HOOKFUNCTION(superspec, BuildMutatorsPrettyString)
        return 0;
 }
 
-void superspec_hello()
-{SELFPARAM();
+void superspec_hello(entity this)
+{
        if(self.enemy.crypto_idfp == "")
                Send_Notification(NOTIF_ONE_ONLY, self.enemy, MSG_INFO, INFO_SUPERSPEC_MISSING_UID);
 
index ad2fb846d83602fc6769f4628b7946677732307b..3e82db0b5070220b590070aaf8b8ea823333e5b4 100644 (file)
@@ -903,8 +903,8 @@ void WaypointSprite_Disown(entity wp, float fadetime)
     }
 }
 
-void WaypointSprite_Think()
-{SELFPARAM();
+void WaypointSprite_Think(entity this)
+{
     bool doremove = false;
 
     if (self.fade_time && time >= self.teleport_time)
index 66ad9d5458cfe25bb154dfc815e3448f175b7de7..385d9fa749653c59048c3dcf7c2f78991a8a5de6 100644 (file)
@@ -160,7 +160,7 @@ void WaypointSprite_Kill(entity wp);
 
 void WaypointSprite_Disown(entity wp, float fadetime);
 
-void WaypointSprite_Think();
+void WaypointSprite_Think(entity this);
 
 bool WaypointSprite_visible_for_player(entity this, entity player, entity view);
 
index ab448b1847e89fa7bfe96c1a4f3867dbf31054d3..3d3c786297c43cb283cd39f43449b4611c98de7b 100644 (file)
@@ -1478,9 +1478,8 @@ NET_HANDLE(ENT_CLIENT_NOTIFICATION, bool is_new)
 #endif
 
 #ifdef SVQC
-void Net_Notification_Remove()
+void Net_Notification_Remove(entity this)
 {
-       SELFPARAM();
        #ifdef NOTIFICATIONS_DEBUG
        Debug_Notification(sprintf(
                "Net_Notification_Remove() at %f: %s '%s - %s' notification\n",
index 6ec82ab6627f8f5ac680da6ed16321891e6ca0eb..ce7d04d1da29975b09c1c7db9cd9c8a92e746163 100644 (file)
@@ -321,7 +321,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = oth;
 
-               WITHSELF(this, gettouch(this)());
+               WITHSELF(this, gettouch(this)(this));
 
                other = oldother;
        }
@@ -330,7 +330,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = this;
 
-               WITHSELF(oth, gettouch(oth)());
+               WITHSELF(oth, gettouch(oth)(oth));
 
                other = oldother;
        }
@@ -360,7 +360,7 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this)  // SV_LinkEdict_TouchAreaGr
                        trace_plane_dist = 0;
                        trace_ent = this;
 
-                       WITHSELF(it, gettouch(it)());
+                       WITHSELF(it, gettouch(it)(it));
                }
     });
 
index 7c08c41abc6a8545814f2812252603f7b4df875d..931a0630dbac126485cff3c1372c3fa8959aeb1a 100644 (file)
@@ -6,7 +6,7 @@
 #define UNSET_ONGROUND(s)                   ((s).flags &= ~FL_ONGROUND)
 
 .float move_ltime;
-.void()move_think;
+.void(entity this) move_think;
 .float move_nextthink;
 .void()move_blocked;
 
index b3cfb875da28a318c6585bd1a91df2f8e1ff64ef..276b10476fff83e05b75b625ed4f0d73a46f6117 100644 (file)
@@ -149,6 +149,6 @@ void _Movetype_Physics_Pusher(entity this, float dt)  // SV_Physics_Pusher
                this.move_nextthink = 0;
                this.move_time = time;
                other = world;
-               WITHSELF(this, this.move_think());
+               WITHSELF(this, this.move_think(this));
        }
 }
index e84c09ef6807b620107636f3d18356e417c98793..90b2758aca3569e841d6cfa185ca2a556847bd2d 100644 (file)
@@ -76,7 +76,7 @@ const float VOL_BASEVOICE = 1.0;
                        auto = true; \
                        __chan = fabs(__chan); \
                        entity tmp = __e = new(csqc_autochannel); \
-                       setthink(tmp, SUB_Remove_self); \
+                       setthink(tmp, SUB_Remove); \
                        tmp.nextthink = time + soundlength(__samp); \
                } \
                vector old_origin = __e.origin; \
index 6ec16667eb88163e414448e18c14fbd3d5fca38d..60ee6c86681c9cea49083b2723a58b6028041ef7 100644 (file)
@@ -471,8 +471,8 @@ void Item_Show (entity e, float mode)
        e.SendFlags |= ISF_STATUS;
 }
 
-void Item_Think()
-{SELFPARAM();
+void Item_Think(entity this)
+{
        self.nextthink = time;
        if(self.origin != self.oldorigin)
                ItemUpdate(self);
@@ -510,8 +510,8 @@ void Item_Respawn ()
        Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
 }
 
-void Item_RespawnCountdown ()
-{SELFPARAM();
+void Item_RespawnCountdown (entity this)
+{
        if(self.count >= ITEM_RESPAWN_TICKS)
        {
                if(self.waypointsprite_attached)
@@ -568,8 +568,8 @@ void Item_RespawnCountdown ()
        }
 }
 
-void Item_RespawnThink()
-{SELFPARAM();
+void Item_RespawnThink(entity this)
+{
        self.nextthink = time;
        if(self.origin != self.oldorigin)
                ItemUpdate(self);
@@ -761,9 +761,8 @@ LABEL(skip)
        return 1;
 }
 
-void Item_Touch()
+void Item_Touch(entity this)
 {
-       SELFPARAM();
 
        // remove the item if it's currnetly in a NODROP brush or hits a NOIMPACT surface (such as sky)
        if (this.classname == "droppedweapon")
@@ -901,8 +900,8 @@ void Item_FindTeam(entity this)
 }
 
 // Savage: used for item garbage-collection
-void RemoveItem()
-{SELFPARAM();
+void RemoveItem(entity this)
+{
        if(wasfreed(self) || !self) { return; }
        Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
        remove(self);
@@ -1028,7 +1027,7 @@ float commodity_pickupevalfunc(entity player, entity item)
 void Item_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(ITEM_DAMAGE_NEEDKILL(deathtype))
-               WITHSELF(this, RemoveItem());
+               WITHSELF(this, RemoveItem(this));
 }
 
 void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter)
index ce8307821ca11b0faea0811529e153eb2614661c..3ba0a0deb87db2ce51440352ff864cd26a73ea18 100644 (file)
@@ -74,7 +74,7 @@ void Item_Show (entity e, float mode);
 
 void Item_Respawn ();
 
-void Item_RespawnCountdown ();
+void Item_RespawnCountdown(entity this);
 void Item_ScheduleRespawnIn(entity e, float t);
 
 void Item_ScheduleRespawn(entity e);
@@ -88,7 +88,7 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax
 
 float Item_GiveTo(entity item, entity player);
 
-void Item_Touch();
+void Item_Touch(entity this);
 
 void Item_Reset(entity this);
 
index 7039d151ad4a7f524115bf9bbb8047b17420811f..e030632498d2c3f0cfb488135edd51245dedc642 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef SVQC
 .float height;
-void func_bobbing_controller_think()
-{SELFPARAM();
+void func_bobbing_controller_think(entity this)
+{
        vector v;
        self.nextthink = time + 0.1;
 
@@ -74,7 +74,7 @@ spawnfunc(func_bobbing)
        controller.nextthink = time + 1;
        setthink(controller, func_bobbing_controller_think);
        this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       this.SUB_THINK = SUB_NullThink;
+       SUB_THINK(this, SUB_NullThink);
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index e11680b40c75fc87a06fe82100b71e37114b2bd1..246762659aafbfcc7a9b3e1e23614432344af4da 100644 (file)
@@ -189,8 +189,8 @@ void func_breakable_restore(entity this, entity actor, entity trigger)
        CSQCMODEL_AUTOUPDATE(this);
 }
 
-void func_breakable_restore_self()
-{SELFPARAM();
+void func_breakable_restore_self(entity this)
+{
        func_breakable_restore(this, NULL, NULL);
 }
 
@@ -231,8 +231,8 @@ void func_breakable_destroy(entity this, entity actor, entity trigger)
        this.message = oldmsg;
 }
 
-void func_breakable_destroy_self()
-{SELFPARAM();
+void func_breakable_destroy_self(entity this)
+{
        func_breakable_destroy(this, NULL, NULL);
 }
 
index 0a0547b58726e64c1c5fde2c7aa3e37b661ba943..5584f9ffa167bbb476fbd16ce6804e08ba3c836f 100644 (file)
@@ -1,25 +1,25 @@
 #ifdef SVQC
 // button and multiple button
 
-void() button_wait;
-void() button_return;
+void button_wait(entity this);
+void button_return(entity this);
 
-void button_wait()
-{SELFPARAM();
+void button_wait(entity this)
+{
        self.state = STATE_TOP;
        self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
-       self.SUB_THINK = button_return;
+       SUB_THINK(self, button_return);
        SUB_UseTargets(self, self.enemy, NULL);
        self.frame = 1;                 // use alternate textures
 }
 
-void button_done()
-{SELFPARAM();
+void button_done(entity this)
+{
        self.state = STATE_BOTTOM;
 }
 
-void button_return()
-{SELFPARAM();
+void button_return(entity this)
+{
        self.state = STATE_DOWN;
        SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, button_done);
        self.frame = 0;                 // use normal textures
@@ -68,8 +68,8 @@ void button_use(entity this, entity actor, entity trigger)
        WITHSELF(this, button_fire());
 }
 
-void button_touch()
-{SELFPARAM();
+void button_touch(entity this)
+{
        if (!other)
                return;
        if (!other.iscreature)
index 6ad2e80d41c33404d7e5535892a2a68963df3635..a4be9fe0538dd1ffad145f2beba54765025de6af 100644 (file)
@@ -1,7 +1,7 @@
 REGISTER_NET_LINKED(ENT_CLIENT_CONVEYOR)
 
-void conveyor_think()
-{SELFPARAM();
+void conveyor_think(entity this)
+{
 #ifdef CSQC
        // TODO: check if this is what is causing the glitchiness when switching between them
        float dt = time - self.move_time;
@@ -147,7 +147,7 @@ spawnfunc(func_conveyor)
 
 #elif defined(CSQC)
 
-void conveyor_draw(entity this) { WITHSELF(this, conveyor_think()); }
+void conveyor_draw(entity this) { WITHSELF(this, conveyor_think(this)); }
 
 void conveyor_init(entity this)
 {
index e0c62c043d97216e7814fd2de4e258cb6a8dc88e..92afdebecaf4c7c2749149b7704bd1bd88002c2f 100644 (file)
@@ -20,9 +20,9 @@ THINK FUNCTIONS
 =============================================================================
 */
 
-void() door_go_down;
+void door_go_down(entity this);
 void() door_go_up;
-void() door_rotating_go_down;
+void door_rotating_go_down(entity this);
 void() door_rotating_go_up;
 
 void door_blocked()
@@ -66,10 +66,10 @@ void door_blocked()
                                else
                        if (self.classname == "door")
                        {
-                               door_go_down ();
+                               door_go_down (self);
                        } else
                        {
-                               door_rotating_go_down ();
+                               door_rotating_go_down (self);
                        }
                        }
                }
@@ -84,8 +84,8 @@ void door_blocked()
        }
 }
 
-void door_hit_top()
-{SELFPARAM();
+void door_hit_top(entity this)
+{
        if (self.noise1 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_TOP;
@@ -93,23 +93,23 @@ void door_hit_top()
                return;         // don't come down automatically
        if (self.classname == "door")
        {
-               self.SUB_THINK = door_go_down;
+               SUB_THINK(self, door_go_down);
        } else
        {
-               self.SUB_THINK = door_rotating_go_down;
+               SUB_THINK(self, door_rotating_go_down);
        }
        self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
 }
 
-void door_hit_bottom()
-{SELFPARAM();
+void door_hit_bottom(entity this)
+{
        if (self.noise1 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_BOTTOM;
 }
 
-void door_go_down()
-{SELFPARAM();
+void door_go_down(entity this)
+{
        if (self.noise2 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        if (self.max_health)
@@ -218,9 +218,9 @@ void door_fire(entity this, entity actor, entity trigger)
                        entity e = this;
                        do {
                                if (e.classname == "door") {
-                                       WITHSELF(e, door_go_down());
+                                       WITHSELF(e, door_go_down(e));
                                } else {
-                                       WITHSELF(e, door_rotating_go_down());
+                                       WITHSELF(e, door_rotating_go_down(e));
                                }
                                e = e.enemy;
                        } while ((e != this) && (e != NULL));
@@ -289,8 +289,8 @@ Prints messages
 ================
 */
 
-void door_touch()
-{SELFPARAM();
+void door_touch(entity this)
+{
        if (!IS_PLAYER(other))
                return;
        if (self.owner.door_finished > time)
@@ -332,7 +332,7 @@ void door_generic_plat_blocked()
                                if (self.state == STATE_DOWN)
                                        door_rotating_go_up ();
                                else
-                                       door_rotating_go_down ();
+                                       door_rotating_go_down (self);
                        }
                }
 #ifdef SVQC
@@ -346,19 +346,19 @@ void door_generic_plat_blocked()
        }
 }
 
-void door_rotating_hit_top()
-{SELFPARAM();
+void door_rotating_hit_top(entity this)
+{
        if (self.noise1 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_TOP;
        if (self.spawnflags & DOOR_TOGGLE)
                return;         // don't come down automatically
-       self.SUB_THINK = door_rotating_go_down;
+       SUB_THINK(self, door_rotating_go_down);
        self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
 }
 
-void door_rotating_hit_bottom()
-{SELFPARAM();
+void door_rotating_hit_bottom(entity this)
+{
        if (self.noise1 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        if (self.lip==666) // self.lip is used to remember reverse opening direction for door_rotating
@@ -369,8 +369,8 @@ void door_rotating_hit_bottom()
        self.state = STATE_BOTTOM;
 }
 
-void door_rotating_go_down()
-{SELFPARAM();
+void door_rotating_go_down(entity this)
+{
        if (self.noise2 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        if (self.max_health)
@@ -414,8 +414,8 @@ Spawned if a door lacks a real activator
 =========================================
 */
 
-void door_trigger_touch()
-{SELFPARAM();
+void door_trigger_touch(entity this)
+{
        if (other.health < 1)
 #ifdef SVQC
                if (!((other.iscreature || (other.flags & FL_PROJECTILE)) && !IS_DEAD(other)))
@@ -688,7 +688,7 @@ void door_reset(entity this)
        SUB_SETORIGIN(this, this.pos1);
        this.SUB_VELOCITY = '0 0 0';
        this.state = STATE_BOTTOM;
-       this.SUB_THINK = func_null;
+       SUB_THINK(this, func_null);
        this.SUB_NEXTTHINK = 0;
 
 #ifdef SVQC
index da88e4dc9b60336d0d7f2c66ca4bdebbe2dc5c35..12008e492d443896506773352d798e0ddbdf569c 100644 (file)
@@ -1,11 +1,11 @@
 #ifdef SVQC
-void() fd_secret_move1;
-void() fd_secret_move2;
-void() fd_secret_move3;
-void() fd_secret_move4;
-void() fd_secret_move5;
-void() fd_secret_move6;
-void() fd_secret_done;
+void fd_secret_move1(entity this);
+void fd_secret_move2(entity this);
+void fd_secret_move3(entity this);
+void fd_secret_move4(entity this);
+void fd_secret_move5(entity this);
+void fd_secret_move6(entity this);
+void fd_secret_done(entity this);
 
 const float SECRET_OPEN_ONCE = 1;              // stays open
 const float SECRET_1ST_LEFT = 2;               // 1st move is left of arrow
@@ -69,8 +69,8 @@ void fd_secret_damage(entity this, entity inflictor, entity attacker, float dama
 }
 
 // Wait after first movement...
-void fd_secret_move1()
-{SELFPARAM();
+void fd_secret_move1(entity this)
+{
        self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0;
        setthink(self, fd_secret_move2);
        if (self.noise3 != "")
@@ -78,16 +78,16 @@ void fd_secret_move1()
 }
 
 // Start moving sideways w/sound...
-void fd_secret_move2()
-{SELFPARAM();
+void fd_secret_move2(entity this)
+{
        if (self.noise2 != "")
                _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3);
 }
 
 // Wait here until time to go back...
-void fd_secret_move3()
-{SELFPARAM();
+void fd_secret_move3(entity this)
+{
        if (self.noise3 != "")
                _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
        if (!(self.spawnflags & SECRET_OPEN_ONCE))
@@ -98,31 +98,31 @@ void fd_secret_move3()
 }
 
 // Move backward...
-void fd_secret_move4()
-{SELFPARAM();
+void fd_secret_move4(entity this)
+{
        if (self.noise2 != "")
                _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5);
 }
 
 // Wait 1 second...
-void fd_secret_move5()
-{SELFPARAM();
+void fd_secret_move5(entity this)
+{
        self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0;
        setthink(self, fd_secret_move6);
        if (self.noise3 != "")
                _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
 }
 
-void fd_secret_move6()
-{SELFPARAM();
+void fd_secret_move6(entity this)
+{
        if (self.noise2 != "")
                _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done);
 }
 
-void fd_secret_done()
-{SELFPARAM();
+void fd_secret_done(entity this)
+{
        if (self.spawnflags&SECRET_YES_SHOOT)
        {
                self.health = 10000;
@@ -150,8 +150,8 @@ secret_touch
 Prints messages
 ================
 */
-void secret_touch()
-{SELFPARAM();
+void secret_touch(entity this)
+{
        if (!other.iscreature)
                return;
        if (self.door_finished > time)
index 057fcdca7190f90c484f407c435fa114b009190d..53366aa1054dcde093ec130031ee5a579ce86c60 100644 (file)
@@ -10,8 +10,8 @@ dmg: Do this mutch dmg every .dmgtime intervall when blocked
 dmgtime: See above.
 */
 
-void func_fourier_controller_think()
-{SELFPARAM();
+void func_fourier_controller_think(entity this)
+{
        vector v;
        float n, i, t;
 
@@ -78,7 +78,7 @@ spawnfunc(func_fourier)
        controller.nextthink = time + 1;
        setthink(controller, func_fourier_controller_think);
        this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       this.SUB_THINK = SUB_NullThink; // for PushMove
+       SUB_THINK(this, SUB_NullThink); // for PushMove
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index 18b72068581d4ca123d056928f11bb83c1a3b7f7..e0108cd8f0f030e0eaaa6124c20f373fa15a349f 100644 (file)
@@ -1,7 +1,7 @@
 REGISTER_NET_LINKED(ENT_CLIENT_LADDER)
 
-void func_ladder_touch()
-{SELFPARAM();
+void func_ladder_touch(entity this)
+{
 #ifdef SVQC
        if (!other.iscreature)
                return;
index bcfc6e886ce6c6334bd8f1b52a5125384a255512..e05b2a6fca08927c0e081f9e1e230a70ad1a0c45 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef SVQC
 .float freq;
-void func_pendulum_controller_think()
-{SELFPARAM();
+void func_pendulum_controller_think(entity this)
+{
        float v;
        self.nextthink = time + 0.1;
 
@@ -67,7 +67,7 @@ spawnfunc(func_pendulum)
        controller.nextthink = time + 1;
        setthink(controller, func_pendulum_controller_think);
        this.nextthink = this.SUB_LTIME + 999999999;
-       this.SUB_THINK = SUB_NullThink; // for PushMove
+       SUB_THINK(this, SUB_NullThink); // for PushMove
 
        //this.effects |= EF_LOWPRECISION;
 
index 7f7ec8eb2619e7c40d3a1ceec076f4ac80c26cb5..a2502da401295ccf5db61240f3346da114e7de19 100644 (file)
@@ -93,8 +93,8 @@ void pointparticles_use(entity this, entity actor, entity trigger)
        this.SendFlags |= 2;
 }
 
-void pointparticles_think()
-{SELFPARAM();
+void pointparticles_think(entity this)
+{
        if(self.origin != self.oldorigin)
        {
                self.SendFlags |= 4;
index 3f9a88f285e672e38ebdf167477c2522dd89ac82..f34d41e2b02af8737d31d8c7e701de75dbe047e6 100644 (file)
@@ -69,7 +69,7 @@ spawnfunc(func_rotating)
 
        // wait for targets to spawn
        this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       this.SUB_THINK = SUB_NullThink; // for PushMove
+       SUB_THINK(this, SUB_NullThink); // for PushMove
 
        // TODO make a reset function for this one
 }
index 6c674d47470dd13c8ac0fd73ae9c2810c0d8c2cf..9c73e2b80b561d77235a122c6bd52dd8cdcd9752 100644 (file)
@@ -1,10 +1,10 @@
 .float train_wait_turning;
-void() train_next;
+void train_next(entity this);
 #ifdef SVQC
 void train_use(entity this, entity actor, entity trigger);
 #endif
-void train_wait()
-{SELFPARAM();
+void train_wait(entity this)
+{
        SUB_UseTargets(this.enemy, NULL, NULL);
        self.enemy = world;
 
@@ -44,7 +44,7 @@ void train_wait()
        if(tg.spawnflags & 4)
        {
                self.use = train_use;
-               self.SUB_THINK = func_null;
+               SUB_THINK(self, func_null);
                self.SUB_NEXTTHINK = 0;
        }
        else
@@ -52,17 +52,17 @@ void train_wait()
             if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
        {
                self.train_wait_turning = false;
-               train_next();
+               train_next(self);
        }
        else
        {
-               self.SUB_THINK = train_next;
+               SUB_THINK(self, train_next);
                self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
        }
 }
 
-void train_next()
-{SELFPARAM();
+void train_next(entity this)
+{
        entity targ, cp = world;
        vector cp_org = '0 0 0';
 
@@ -179,7 +179,7 @@ void train_link()
 void train_use(entity this, entity actor, entity trigger)
 {
        this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
-       this.SUB_THINK = train_next;
+       SUB_THINK(this, train_next);
        this.use = func_null; // not again
 }
 
@@ -195,7 +195,7 @@ void func_train_find(entity this)
        if(!(self.spawnflags & 4))
        {
                self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
-               self.SUB_THINK = train_next;
+               SUB_THINK(self, train_next);
        }
 
        train_link();
@@ -324,7 +324,7 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew)
                // but we will need these
                //this.move_nextthink = this.move_ltime + 0.1;
                //this.move_think = train_next;
-               WITHSELF(this, train_next());
+               WITHSELF(this, train_next(this));
 
                this.move_movetype = MOVETYPE_PUSH;
                this.move_origin = this.origin;
index eb7a5428bc38b2ce0b41719d5886b3a1e6085e5f..b3e931b3a364f66f7e5389a396dc9fdde2aa3111 100644 (file)
@@ -57,8 +57,8 @@ vector func_vectormamamam_origin(entity o, float t)
        return v;
 }
 
-void func_vectormamamam_controller_think()
-{SELFPARAM();
+void func_vectormamamam_controller_think(entity this)
+{
        self.nextthink = time + 0.1;
 
        if(self.owner.active != ACTIVE_ACTIVE)
@@ -146,7 +146,7 @@ spawnfunc(func_vectormamamam)
 
        // wait for targets to spawn
        this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       this.SUB_THINK = SUB_NullThink; // for PushMove
+       SUB_THINK(this, SUB_NullThink); // for PushMove
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index 937d68caf155da781f52f8bcac6f04555f2060bf..f0aafc7c40e5d06238324f87b0eb6d14dec518bb 100644 (file)
@@ -56,8 +56,8 @@ void misc_laser_init(entity this)
 }
 
 .entity pusher;
-void misc_laser_think()
-{SELFPARAM();
+void misc_laser_think(entity this)
+{
        vector o;
        entity hitent;
        vector hitloc;
index d16509596f339d5ef2441e77eeee16edacbd5a1b..7b583f1d3d370545b900505b40167cadb966c2e3 100644 (file)
@@ -58,23 +58,23 @@ void plat_spawn_inside_trigger()
        objerror("plat_spawn_inside_trigger: platform has odd size or lip, can't spawn");
 }
 
-void plat_hit_top()
-{SELFPARAM();
+void plat_hit_top(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 1;
 
-       self.SUB_THINK = plat_go_down;
+       SUB_THINK(self, plat_go_down);
        self.SUB_NEXTTHINK = self.SUB_LTIME + 3;
 }
 
-void plat_hit_bottom()
-{SELFPARAM();
+void plat_hit_bottom(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 2;
 }
 
-void plat_go_down()
-{SELFPARAM();
+void plat_go_down(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 3;
        SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
@@ -87,8 +87,8 @@ void plat_go_up()
        SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
 }
 
-void plat_center_touch()
-{SELFPARAM();
+void plat_center_touch(entity this)
+{
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -108,8 +108,8 @@ void plat_center_touch()
                self.enemy.SUB_NEXTTHINK = self.enemy.SUB_LTIME + 1;
 }
 
-void plat_outside_touch()
-{SELFPARAM();
+void plat_outside_touch(entity this)
+{
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -121,8 +121,10 @@ void plat_outside_touch()
                return;
 #endif
 
-       if (self.enemy.state == 1)
-               WITHSELF(self.enemy, plat_go_down());
+       if (self.enemy.state == 1) {
+           entity e = self.enemy;
+               WITHSELF(e, plat_go_down(e));
+    }
 }
 
 void plat_trigger_use(entity this, entity actor, entity trigger)
@@ -134,7 +136,7 @@ void plat_trigger_use(entity this, entity actor, entity trigger)
        if(this.move_think)
                return;
 #endif
-       WITHSELF(this, plat_go_down());
+       WITHSELF(this, plat_go_down(this));
 }
 
 
@@ -159,7 +161,7 @@ void plat_crush()
 #endif
 
                if (self.state == 4)
-                       plat_go_down ();
+                       plat_go_down (self);
                else if (self.state == 3)
                        plat_go_up ();
        // when in other states, then the plat_crush event came delayed after
@@ -173,7 +175,7 @@ void plat_use(entity this, entity actor, entity trigger)
        this.use = func_null;
        if (this.state != 4)
                objerror ("plat_use: not in up state");
-       WITHSELF(this, plat_go_down());
+       WITHSELF(this, plat_go_down(this));
 }
 
 .string sound1, sound2;
index 9a32e327a23fd324d2a21c34bf0a136c38f65dba..f73da630fd0cd174ec27c04b2a7825931ff76e1d 100644 (file)
@@ -3,11 +3,11 @@
 
 .float dmgtime2;
 
-void() plat_center_touch;
-void() plat_outside_touch;
+void plat_center_touch(entity this);
+void plat_outside_touch(entity this);
 void plat_trigger_use(entity this, entity actor, entity trigger);
 void() plat_go_up;
-void() plat_go_down;
+void plat_go_down(entity this);
 void() plat_crush;
 const float PLAT_LOW_TRIGGER = 1;
 
index bcc7c057c26ef233ea0aa02c87806ea7fef84ccb..c2be7c72d925ecd12176b44d56ab3423354ae5c2 100644 (file)
@@ -1,7 +1,7 @@
-void SUB_NullThink() { }
+void SUB_NullThink(entity this) { }
 
-void()  SUB_CalcMoveDone;
-void() SUB_CalcAngleMoveDone;
+void SUB_CalcMoveDone(entity this);
+void SUB_CalcAngleMoveDone(entity this);
 
 /*
 ==================
@@ -44,11 +44,11 @@ void SUB_VanishOrRemove (entity ent)
        }
 }
 
-void SUB_SetFade_Think ()
-{SELFPARAM();
+void SUB_SetFade_Think (entity this)
+{
        if(this.alpha == 0)
                this.alpha = 1;
-       this.SUB_THINK = SUB_SetFade_Think;
+       SUB_THINK(this, SUB_SetFade_Think);
        this.SUB_NEXTTHINK = time;
        this.alpha -= frametime * this.fade_rate;
        if (this.alpha < 0.01)
@@ -67,7 +67,7 @@ Fade 'ent' out when time >= 'when'
 void SUB_SetFade (entity ent, float when, float fading_time)
 {
        ent.fade_rate = 1/fading_time;
-       ent.SUB_THINK = SUB_SetFade_Think;
+       SUB_THINK(ent, SUB_SetFade_Think);
        ent.SUB_NEXTTHINK = when;
 }
 
@@ -79,20 +79,20 @@ calculate self.SUB_VELOCITY and self.SUB_NEXTTHINK to reach dest from
 self.SUB_ORIGIN traveling at speed
 ===============
 */
-void SUB_CalcMoveDone ()
-{SELFPARAM();
+void SUB_CalcMoveDone(entity this)
+{
        // After moving, set origin to exact final destination
 
        SUB_SETORIGIN (self, self.finaldest);
        self.SUB_VELOCITY = '0 0 0';
        self.SUB_NEXTTHINK = -1;
        if (self.think1)
-               self.think1 ();
+               self.think1 (self);
 }
 
 .float platmovetype_turn;
-void SUB_CalcMove_controller_think ()
-{SELFPARAM();
+void SUB_CalcMove_controller_think (entity this)
+{
        float traveltime;
        float phasepos;
        float nexttick;
@@ -143,9 +143,9 @@ void SUB_CalcMove_controller_think ()
        {
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
                entity own = self.owner;
-               own.SUB_THINK = self.think1;
+               SUB_THINK(own, self.think1);
                remove(self);
-               WITHSELF(own, own.SUB_THINK());
+               WITHSELF(own, SUB_THUNK(own)(own));
        }
 }
 
@@ -183,7 +183,7 @@ float TSPEED_START = 1;
 float TSPEED_END = 2;
 // TODO average too?
 
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func)
+void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
 {SELFPARAM();
        float   traveltime;
        entity controller;
@@ -193,7 +193,7 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float
 
        self.think1 = func;
        self.finaldest = tdest;
-       self.SUB_THINK = SUB_CalcMoveDone;
+       SUB_THINK(self, SUB_CalcMoveDone);
 
        switch(tspeedtype)
        {
@@ -229,17 +229,17 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float
        controller.animstate_starttime = time;
        controller.animstate_endtime = time + traveltime;
        setthink(controller, SUB_CalcMove_controller_think);
-       controller.think1 = self.SUB_THINK;
+       controller.think1 = SUB_THUNK(self);
 
        // the thinking is now done by the controller
-       self.SUB_THINK = SUB_NullThink; // for PushMove
+       SUB_THINK(self, SUB_NullThink); // for PushMove
        self.SUB_NEXTTHINK = self.SUB_LTIME + traveltime;
 
        // invoke controller
-       WITHSELF(controller, getthink(controller)());
+       WITHSELF(controller, getthink(controller)(controller));
 }
 
-void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
+void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void(entity this) func)
 {SELFPARAM();
        vector  delta;
        float   traveltime;
@@ -249,7 +249,7 @@ void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
 
        self.think1 = func;
        self.finaldest = tdest;
-       self.SUB_THINK = SUB_CalcMoveDone;
+       SUB_THINK(self, SUB_CalcMoveDone);
 
        if (tdest == self.SUB_ORIGIN)
        {
@@ -288,7 +288,7 @@ void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
        SUB_CalcMove_Bezier((self.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
 }
 
-void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func)
+void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
 {
        WITHSELF(ent, SUB_CalcMove(tdest, tspeedtype, tspeed, func));
 }
@@ -303,18 +303,18 @@ self.angles rotating
 The calling function should make sure self.SUB_THINK is valid
 ===============
 */
-void SUB_CalcAngleMoveDone ()
-{SELFPARAM();
+void SUB_CalcAngleMoveDone(entity this)
+{
        // After rotating, set angle to exact final angle
        self.angles = self.finalangle;
        self.SUB_AVELOCITY = '0 0 0';
        self.SUB_NEXTTHINK = -1;
        if (self.think1)
-               self.think1 ();
+               self.think1 (self);
 }
 
 // FIXME: I fixed this function only for rotation around the main axes
-void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void() func)
+void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void(entity this) func)
 {SELFPARAM();
        vector  delta;
        float   traveltime;
@@ -343,7 +343,7 @@ void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void()
 
        self.think1 = func;
        self.finalangle = destangle;
-       self.SUB_THINK = SUB_CalcAngleMoveDone;
+       SUB_THINK(self, SUB_CalcAngleMoveDone);
 
        if (traveltime < 0.1)
        {
@@ -356,7 +356,7 @@ void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void()
        self.SUB_NEXTTHINK = self.SUB_LTIME + traveltime;
 }
 
-void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func)
+void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
 {
        WITHSELF(ent, SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func));
 }
index 6a844261379a971e3d76da1a371008aac2c3f63a..1ce3ea2e9e842864e7315270fab82622a784af81 100644 (file)
@@ -9,7 +9,8 @@
        #define SUB_ORIGIN                      origin
        #define SUB_SETORIGIN(s,v)      setorigin((s), (v))
        #define SUB_NEXTTHINK           nextthink
-       #define SUB_THINK                       think
+       #define SUB_THINK(e, f)     setthink(e, f)
+       #define SUB_THUNK(e)        getthink(e)
        #define SUB_LTIME                       ltime
        #define SUB_FLAGS                       flags
 
@@ -22,7 +23,8 @@
        #define SUB_AVELOCITY   move_avelocity
        #define SUB_ORIGIN              move_origin
        #define SUB_NEXTTHINK   move_nextthink
-       #define SUB_THINK               move_think
+       #define SUB_THINK(e, f) ((e).move_think = (f))
+       #define SUB_THUNK(e)    ((e).move_think)
        #define SUB_LTIME               move_ltime
        #define SUB_FLAGS               move_flags
 
@@ -41,7 +43,7 @@ void SUB_SetFade (entity ent, float when, float fading_time);
 void SUB_VanishOrRemove (entity ent);
 
 .vector                finaldest, finalangle;          //plat.qc stuff
-.void()                think1;
+.void(entity this) think1;
 .float state;
 .float         t_length, t_width;
 
index c6fca4c7ea1169d36ddcf74e5b7e5b83febc5d45..32237200ee9bd93abda850564cb8bf9054800535 100644 (file)
@@ -252,8 +252,8 @@ void Net_TargetMusic()
        }
 }
 
-void Ent_TriggerMusic_Think()
-{SELFPARAM();
+void Ent_TriggerMusic_Think(entity this)
+{
        if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, self, world))
        {
                music_trigger = self;
index 1884879764f20d0e21f3f75f83cb56a8d5f5a093..ff8b12fda49aa744a7b649e61360b0faf8ac3a04 100644 (file)
@@ -18,7 +18,7 @@ void TargetMusic_Advance();
 
 void Net_TargetMusic();
 
-void Ent_TriggerMusic_Think();
+void Ent_TriggerMusic_Think(entity this);
 
 void Ent_TriggerMusic_Remove();
 
index 9366678b15c50dd79db5f194dcc3aadfec7d6a57..ef47b0c6c8d00f180394f9f882d6bac61950d80d 100644 (file)
@@ -17,7 +17,7 @@ const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
 
 entity Simple_TeleportPlayer(entity teleporter, entity player);
 
-void Teleport_Touch ();
+void Teleport_Touch (entity this);
 
 void teleport_findtarget(entity this);
 
index c9ea32501938ac09f8c23959578150e3e62a6fce..197ea9271be5cb4bb5140f4e1d460635e2117899 100644 (file)
@@ -12,8 +12,8 @@ void trigger_gravity_remove(entity own)
                backtrace("Removing a trigger_gravity_check with no valid owner");
        own.trigger_gravity_check = world;
 }
-void trigger_gravity_check_think()
-{SELFPARAM();
+void trigger_gravity_check_think(entity this)
+{
        // This spawns when a player enters the gravity zone and checks if he left.
        // Each frame, self.count is set to 2 by trigger_gravity_touch() and decreased by 1 here.
        // It the player has left the gravity trigger, this will be allowed to reach 0 and indicate that.
@@ -37,8 +37,8 @@ void trigger_gravity_use(entity this, entity actor, entity trigger)
        this.state = !this.state;
 }
 
-void trigger_gravity_touch()
-{SELFPARAM();
+void trigger_gravity_touch(entity this)
+{
        float g;
 
        if(self.state != true)
index e5a98b8cb81f052f80b031ff0b28882bc9aa2f54..25d824d7a62f0953dd6f5538a4bd1771cf565fb4 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef SVQC
 .float triggerhealtime;
-void trigger_heal_touch()
-{SELFPARAM();
+void trigger_heal_touch(entity this)
+{
        if (self.active != ACTIVE_ACTIVE)
                return;
 
index 8eaf0ec5ef58f554438e7557cf487a78b0c46d56..82199a39311ec56ee18d3acdb2e718818afdb0ed 100644 (file)
@@ -8,8 +8,8 @@ void trigger_hurt_use(entity this, entity actor, entity trigger)
 }
 
 .float triggerhurttime;
-void trigger_hurt_touch()
-{SELFPARAM();
+void trigger_hurt_touch(entity this)
+{
        if (self.active != ACTIVE_ACTIVE)
                return;
 
index f5feccef0d4b0f4714d79f63a684ff5cf6f59067..d45a82b53c41dc2450710f8bc2d3397ea4fbaadd 100644 (file)
@@ -1,6 +1,6 @@
 // targeted (directional) mode
-void trigger_impulse_touch1()
-{SELFPARAM();
+void trigger_impulse_touch1(entity this)
+{
        entity targ;
        float pushdeltatime;
        float str;
@@ -74,8 +74,8 @@ void trigger_impulse_touch1()
 }
 
 // Directionless (accelerator/decelerator) mode
-void trigger_impulse_touch2()
-{SELFPARAM();
+void trigger_impulse_touch2(entity this)
+{
        float pushdeltatime;
 
        if (self.active != ACTIVE_ACTIVE)
@@ -102,8 +102,8 @@ void trigger_impulse_touch2()
 }
 
 // Spherical (gravity/repulsor) mode
-void trigger_impulse_touch3()
-{SELFPARAM();
+void trigger_impulse_touch3(entity this)
+{
        float pushdeltatime;
        float str;
 
index be2ef03c04dadcb6f6468b4009040e5b35e287f0..cbb2f03279d859bb79b84efd52803ebd771412f3 100644 (file)
@@ -129,8 +129,8 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
        return sdir * vs + '0 0 1' * vz;
 }
 
-void trigger_push_touch()
-{SELFPARAM();
+void trigger_push_touch(entity this)
+{
        if (this.active == ACTIVE_NOT)
                return;
 
@@ -263,7 +263,7 @@ void trigger_push_touch()
        if (this.spawnflags & PUSH_ONCE)
        {
                settouch(this, func_null);
-               setthink(this, SUB_Remove_self);
+               setthink(this, SUB_Remove);
                this.nextthink = time;
        }
 #endif
index 6fd61dc9da7561fb0bd684d30e50f95113267917..4e8bf1809fd24840637abeb5a3aa27e31109bd41 100644 (file)
@@ -35,7 +35,7 @@ void trigger_push_use(entity this, entity actor, entity trigger);
 
 vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
 
-void trigger_push_touch();
+void trigger_push_touch(entity this);
 
 .vector dest;
 void trigger_push_findtarget(entity this);
index b3e6a5b09023d17e1284a91a22d0afdbddceacdf..e90eb1853affc2dc4e51097b1889980af8f07853 100644 (file)
@@ -18,8 +18,8 @@ void trigger_keylock_kill(string s)
                remove(t);
 }
 
-void trigger_keylock_touch()
-{SELFPARAM();
+void trigger_keylock_touch(entity this)
+{
        bool key_used = false;
        bool started_delay = false;
 
index f9738714e636a75e80fb829fa63186c95eed02ad..018e20884b25938e7d17fba6fc0764948c2aad1d 100644 (file)
@@ -21,8 +21,8 @@ void monoflop_fixed_use(entity this, entity actor, entity trigger)
        SUB_UseTargets(this, actor, trigger);
 }
 
-void monoflop_think()
-{SELFPARAM();
+void monoflop_think(entity this)
+{
        this.state = 0;
        SUB_UseTargets(this, this.enemy, NULL);
 }
index 5ebe7017957ea7d94eaca4310f77133b8a43b3c9..435255727e7f4139e83baebe29266bdf8291f827 100644 (file)
@@ -2,8 +2,8 @@
 
 #ifdef SVQC
 // the wait time has passed, so set back up for another activation
-void multi_wait()
-{SELFPARAM();
+void multi_wait(entity this)
+{
        if (this.max_health)
        {
                this.health = this.max_health;
@@ -50,7 +50,7 @@ void multi_trigger(entity this)
        }
        else if (this.wait == 0)
        {
-               WITHSELF(this, multi_wait()); // waiting finished
+               WITHSELF(this, multi_wait(this)); // waiting finished
        }
        else
        {       // we can't just remove (this) here, because this is a touch function
@@ -66,8 +66,8 @@ void multi_use(entity this, entity actor, entity trigger)
        multi_trigger(this);
 }
 
-void multi_touch()
-{SELFPARAM();
+void multi_touch(entity this)
+{
        if(!(self.spawnflags & 2))
        if(!other.iscreature)
                        return;
index 2c17fbb0d1e9cbb339ac5cc5be388d40d88d3471..1a1850537d4f29cd7bdde118395ea007e1d1716d 100644 (file)
@@ -18,8 +18,8 @@ void multivibrator_send(entity this)
                this.nextthink = cyclestart + this.wait + this.respawntime + 0.01;
 }
 
-void multivibrator_send_think()
-{SELFPARAM();
+void multivibrator_send_think(entity this)
+{
        multivibrator_send(this);
 }
 
index e6e4c4bf90a2fb8339ab6bb82ed2be6a9569b1bb..a6f40be3ea5521a909f7d0df6c649e995e0da39c 100644 (file)
@@ -17,8 +17,8 @@ void secrets_setstatus()
 /**
  * A secret has been found (maybe :P)
  */
-void trigger_secret_touch()
-{SELFPARAM();
+void trigger_secret_touch(entity this)
+{
        // only a player can trigger this
        if (!IS_PLAYER(other))
                return;
@@ -33,7 +33,7 @@ void trigger_secret_touch()
        self.message = "";
 
        // handle normal trigger features
-       multi_touch();
+       multi_touch(self);
        remove(self);
 }
 
index 4c514df2d46a9ab7402ca615926c240ff98ec8c2..3a1cf9530b0c44ceed0c5b797f27ae4e38b5ea62 100644 (file)
@@ -22,8 +22,8 @@
 #ifdef SVQC
 spawnfunc(trigger_swamp);
 #endif
-void swamp_touch();
-void swampslug_think();
+void swamp_touch(entity this);
+void swampslug_think(entity this);
 
 
 /*
@@ -36,8 +36,8 @@ void swampslug_think();
 *
 * I do it this way becuz there is no "untouch" event.
 */
-void swampslug_think()
-{SELFPARAM();
+void swampslug_think(entity this)
+{
        //Slowly kill the slug
        self.health = self.health - 1;
 
@@ -60,8 +60,8 @@ void swampslug_think()
        self.nextthink = time + self.swamp_interval;
 }
 
-void swamp_touch()
-{SELFPARAM();
+void swamp_touch(entity this)
+{
        // If whatever thats touching the swamp is not a player
        // or if its a dead player, just dont care abt it.
        if(!IS_PLAYER(other) || IS_DEAD(other))
index f32a5199f22fd4a9a462d35d229929cca5c494c5..54777b75cb1aa57723aa5d0c4d90c6556bdcaeb7 100644 (file)
@@ -11,8 +11,8 @@ void trigger_teleport_use(entity this, entity actor, entity trigger)
 }
 #endif
 
-void Teleport_Touch ()
-{SELFPARAM();
+void Teleport_Touch (entity this)
+{
        if (self.active != ACTIVE_ACTIVE)
                return;
 
index bfd6db1dcc51636e9c01807e73c6c5cd080b899f..d65fe953f39d2de0bd015d6ed74f747e53f5591c 100644 (file)
@@ -10,8 +10,8 @@ REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC_TRIGGER)
 
 #ifdef SVQC
 
-void viewloc_think()
-{SELFPARAM();
+void viewloc_think(entity this)
+{
        entity e;
 
        // we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities
@@ -134,8 +134,8 @@ spawnfunc(target_viewlocation) { spawnfunc_target_viewlocation_start(this); }
 
 #elif defined(CSQC)
 
-void trigger_viewloc_updatelink()
-{SELFPARAM();
+void trigger_viewloc_updatelink(entity this)
+{
        self.enemy = findfloat(world, entnum, self.cnt);
        self.goalentity = findfloat(world, entnum, self.count);
 }
index 572515189e5c8660450c8876dce75a6ed7bb6fa0..d9c6a08126a90672e85be1966b31144faeba8ef2 100644 (file)
@@ -2,8 +2,8 @@ void SUB_DontUseTargets(entity this, entity actor, entity trigger) { }
 
 void SUB_UseTargets(entity this, entity actor, entity trigger);
 
-void DelayThink()
-{SELFPARAM();
+void DelayThink(entity this)
+{
        SUB_UseTargets (this, this.enemy, NULL);
        remove(this);
 }
@@ -276,7 +276,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
                RandomSelection_chosen_ent.use(RandomSelection_chosen_ent, actor, this);
 }
 
-void SUB_UseTargets_self()
-{SELFPARAM();
+void SUB_UseTargets_self(entity this)
+{
        SUB_UseTargets(this, NULL, NULL);
 }
index d24e9d74f4d5bc8792e4a86b37d25af8894caf68..2f3b11a7d9f76716d86f2facf36570ca4ae807f5 100644 (file)
@@ -51,8 +51,8 @@ If a loop is of targets are formed, any unit entering this loop will patrol it i
 If the checkpoint chain in not looped, the unit will go "Roaming" when the last point is reached.
 */
 //float tc_acum;
-void turret_checkpoint_init()
-{SELFPARAM();
+void turret_checkpoint_init(entity this)
+{
     traceline(self.origin + '0 0 16', self.origin - '0 0 1024', MOVE_WORLDONLY, self);
     setorigin(self, trace_endpos + '0 0 32');
 
index 31021868996a0f2d3e3058a323def730b34dd819..0fc168c2cac60c85a1d2035aa89d1ac132085b40 100644 (file)
@@ -313,8 +313,8 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
        return gib;
 }
 
-void turret_die()
-{SELFPARAM();
+void turret_die(entity this)
+{
        sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
        pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
        if (!autocvar_cl_nogibs)
@@ -432,7 +432,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
 
                _tmp = ReadByte();
                if(_tmp == 0 && this.health != 0)
-                       turret_die();
+                       turret_die(this);
                else if(this.health && this.health != _tmp)
                        this.helpme = servertime + 10;
 
index 138c87e88d568349b3dabb4ca7aaf1b50a09a3c1..66b3f3dbb61d864a744a620845d809db1b32e0dc 100644 (file)
@@ -164,15 +164,15 @@ float turret_targetscore_generic(entity _turret, entity _target)
 }
 
 // Generic damage handling
-void turret_hide()
-{SELFPARAM();
+void turret_hide(entity this)
+{
        self.effects   |= EF_NODRAW;
        self.nextthink = time + self.respawntime - 0.2;
        setthink(self, turret_respawn);
 }
 
-void turret_die()
-{SELFPARAM();
+void turret_die(entity this)
+{
        self.deadflag             = DEAD_DEAD;
        self.tur_head.deadflag = self.deadflag;
 
@@ -251,9 +251,9 @@ void turret_damage(entity this, entity inflictor, entity attacker, float damage,
        this.SendFlags  |= TNSF_STATUS;
 }
 
-void() turret_think;
-void turret_respawn()
-{SELFPARAM();
+void turret_think(entity this);
+void turret_respawn(entity this)
+{
        // Make sure all parts belong to the same team since
        // this function doubles as "teamchange" function.
        self.tur_head.team      = self.team;
@@ -427,8 +427,8 @@ void load_unit_settings(entity ent, bool is_reload)
        }
 }
 
-void turret_projectile_explode()
-{SELFPARAM();
+void turret_projectile_explode(entity this)
+{
 
        self.takedamage = DAMAGE_NO;
        self.event_damage = func_null;
@@ -443,10 +443,10 @@ void turret_projectile_explode()
        remove(self);
 }
 
-void turret_projectile_touch()
+void turret_projectile_touch(entity this)
 {
        PROJECTILE_TOUCH;
-       turret_projectile_explode();
+       turret_projectile_explode(this);
 }
 
 void turret_projectile_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
@@ -1011,8 +1011,8 @@ void turret_fire()
 #endif
 }
 
-void turret_think()
-{SELFPARAM();
+void turret_think(entity this)
+{
        self.nextthink = time + self.ticrate;
 
        MUTATOR_CALLHOOK(TurretThink, self);
@@ -1194,9 +1194,8 @@ void turret_link()
        self.tur_head.effects = EF_NODRAW;
 }
 
-void turrets_manager_think()
+void turrets_manager_think(entity this)
 {
-       SELFPARAM();
        this.nextthink = time + 1;
 
        if (autocvar_g_turrets_reloadcvars == 1)
@@ -1380,7 +1379,7 @@ float turret_initialize(Turret tur)
 #endif
 
        turret_link();
-       turret_respawn();
+       turret_respawn(self);
        turret_tag_fire_update();
 
        tur.tr_setup(tur, self);
index 622f2360f7d0aec8fd6ad109129a04e98972ffa8..1d492e8164a057cf17f799ef58a773f532461803 100644 (file)
@@ -2,7 +2,7 @@
 #define SV_TURRETS_H
 
 entity turret_projectile(Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim);
-void turret_projectile_explode();
+void turret_projectile_explode(entity this);
 float turret_validate_target(entity e_turret, entity e_target, float validate_flags);
 float turret_firecheck();
 entity turret_select_target();
@@ -77,7 +77,7 @@ const float TFL_TRACKTYPE_FLUIDINERTIA = 3; // simulated inertia ("wobbly" mode)
 .float track_accel_rotate;
 .float track_blendrate;
 
-void() turret_respawn;
+void turret_respawn(entity this);
 
 /// updates aim org, shot org, shot dir and enemy org for selected turret
 void turret_do_updates(entity e_turret);
index 01dced5f3c403f0ec3af2ad263290d7ba64186c1..4828bf0b34c17b078126affea19477e9d7929014 100644 (file)
@@ -1,8 +1,8 @@
 spawnfunc(turret_targettrigger);
-void turret_targettrigger_touch();
+void turret_targettrigger_touch(entity this);
 
-void turret_targettrigger_touch()
-{SELFPARAM();
+void turret_targettrigger_touch(entity this)
+{
     if (this.cnt > time) return;
     FOREACH_ENTITY_STRING_ORDERED(targetname, this.target, {
         if (!(it.turret_flags & TUR_FLAG_RECIEVETARGETS)) continue;
index fd7179f162bed8a0f7f0c28136d56647e655b75f..eb8db7358f5820807035b1f445266ba45716d726 100644 (file)
@@ -4,7 +4,7 @@
 
 #ifdef SVQC
 
-void turret_flac_projectile_think_explode();
+void turret_flac_projectile_think_explode(entity this);
 SOUND(FlacAttack_FIRE, W_Sound("electro_fire"));
 METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
@@ -36,9 +36,8 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponen
     }
 }
 
-void turret_flac_projectile_think_explode()
+void turret_flac_projectile_think_explode(entity this)
 {
-    SELFPARAM();
     if(self.enemy != world)
     if(vdist(self.origin - self.enemy.origin, <, self.owner.shot_radius * 3))
         setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
index 6fd5bd09147c0f6d1960a51804f661d7119a98d7..2b80607ce7e1b66ee4fe29b985723de419c415d7 100644 (file)
@@ -7,7 +7,7 @@
 float autocvar_g_turrets_unit_hellion_shot_speed_gain;
 float autocvar_g_turrets_unit_hellion_shot_speed_max;
 
-void turret_hellion_missile_think();
+void turret_hellion_missile_think(entity this);
 SOUND(HellionAttack_FIRE, W_Sound("electro_fire"));
 METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
@@ -41,8 +41,8 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo
     }
 }
 
-void turret_hellion_missile_think()
-{SELFPARAM();
+void turret_hellion_missile_think(entity this)
+{
     vector olddir,newdir;
     vector pre_pos;
     float itime;
@@ -52,7 +52,7 @@ void turret_hellion_missile_think()
     olddir = normalize(self.velocity);
 
     if(self.max_health < time)
-        turret_projectile_explode();
+        turret_projectile_explode(self);
 
     // Enemy dead? just keep on the current heading then.
     if ((self.enemy == world) || (IS_DEAD(self.enemy)))
@@ -65,7 +65,7 @@ void turret_hellion_missile_think()
         self.angles = vectoangles(self.velocity);
 
         if(vdist(self.origin - self.owner.origin, >, (self.owner.shot_radius * 5)))
-            turret_projectile_explode();
+            turret_projectile_explode(self);
 
         // Accelerate
         self.velocity = olddir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
@@ -77,7 +77,7 @@ void turret_hellion_missile_think()
 
     // Enemy in range?
     if(vdist(self.origin - self.enemy.origin, <, self.owner.shot_radius * 0.2))
-        turret_projectile_explode();
+        turret_projectile_explode(self);
 
     // Predict enemy position
     itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
index ca99cca9029890bb9cdb0e3dab319faf18a27439..dffe83c8283d135b220e0cd4509269de57be9458 100644 (file)
@@ -11,7 +11,7 @@ float autocvar_g_turrets_unit_hk_shot_speed_decel;
 float autocvar_g_turrets_unit_hk_shot_speed_max;
 float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
 
-void turret_hk_missile_think();
+void turret_hk_missile_think(entity this);
 SOUND(HunterKillerAttack_FIRE, W_Sound("electro_fire"));
 METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -45,8 +45,8 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity
 }
 
 bool hk_is_valid_target(entity e_target);
-void turret_hk_missile_think()
-{SELFPARAM();
+void turret_hk_missile_think(entity this)
+{
     vector vu, vd, vf, vl, vr, ve;  // Vector (direction)
     float  fu, fd, ff, fl, fr, fe;  // Fraction to solid
     vector olddir,wishdir,newdir;   // Final direction
@@ -95,7 +95,7 @@ void turret_hk_missile_think()
         // Close enougth to do decent damage?
         if ( edist <= (self.owner.shot_radius * 0.25) )
         {
-            turret_projectile_explode();
+            turret_projectile_explode(self);
             return;
         }
 
index 17622fe1db7431f4204dc61fee2e12cf11fced30..1f6d62c95b78bb7fa13a81b8955b00ef4f6b2a05 100644 (file)
@@ -3,7 +3,7 @@
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
-void beam_think();
+void beam_think(entity this);
 
 .int fireflag;
 SOUND(PhaserTurretAttack_FIRE, W_Sound("electro_fire"));
@@ -52,8 +52,8 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
     }
 }
 
-void beam_think()
-{SELFPARAM();
+void beam_think(entity this)
+{
     if ((time > self.cnt) || (IS_DEAD(self.owner)))
     {
         self.owner.attack_finished_single[0] = time + self.owner.shot_refire;
index c2cedf0a2e4593a871ad98b333f6b3ee3ee6f29e..de7d282ec942fa170a9c8059aaca81a6110d9ed4 100644 (file)
@@ -97,8 +97,8 @@ void walker_setnoanim(entity this)
     turrets_setframe(ANIM_NO, false);
     self.animflag = self.frame;
 }
-void walker_rocket_explode()
-{SELFPARAM();
+void walker_rocket_explode(entity this)
+{
     RadiusDamage (self, self.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), self, world, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, world);
     remove (self);
 }
@@ -113,9 +113,9 @@ void walker_rocket_damage(entity this, entity inflictor, entity attacker, float
 }
 
 #define WALKER_ROCKET_MOVE movelib_move_simple(self, newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(self)
-void walker_rocket_loop();
-void walker_rocket_think()
-{SELFPARAM();
+void walker_rocket_loop(entity this);
+void walker_rocket_think(entity this)
+{
     vector newdir;
     float edist;
     float itime;
@@ -148,7 +148,7 @@ void walker_rocket_think()
 
     if (self.shot_dmg != 1337 && random() < 0.01)
     {
-        walker_rocket_loop();
+        walker_rocket_loop(self);
         return;
     }
 
@@ -169,8 +169,8 @@ void walker_rocket_think()
     WALKER_ROCKET_MOVE;
 }
 
-void walker_rocket_loop3()
-{SELFPARAM();
+void walker_rocket_loop3(entity this)
+{
     vector newdir;
     self.nextthink = time;
 
@@ -192,8 +192,8 @@ void walker_rocket_loop3()
     self.angles = vectoangles(self.velocity);
 }
 
-void walker_rocket_loop2()
-{SELFPARAM();
+void walker_rocket_loop2(entity this)
+{
     vector newdir;
 
     self.nextthink = time;
@@ -215,8 +215,8 @@ void walker_rocket_loop2()
     WALKER_ROCKET_MOVE;
 }
 
-void walker_rocket_loop()
-{SELFPARAM();
+void walker_rocket_loop(entity this)
+{
     self.nextthink = time;
     self.tur_shotorg = self.origin + '0 0 300';
     setthink(self, walker_rocket_loop2);
index 2fb60210fe7698e646a59f6fede5fde83900179c..19b71a0cee8cd618a1282db6379988652a89c66b 100644 (file)
@@ -213,8 +213,8 @@ void vehicles_projectile_damage(entity this, entity inflictor, entity attacker,
        }
 }
 
-void vehicles_projectile_explode()
-{SELFPARAM();
+void vehicles_projectile_explode(entity this)
+{
        if(self.owner && other != world)
        {
                if(other == self.owner.vehicle)
@@ -234,7 +234,7 @@ void vehicles_projectile_explode()
 
 void vehicles_projectile_explode_use(entity this, entity actor, entity trigger)
 {
-       WITHSELF(this, vehicles_projectile_explode());
+       WITHSELF(this, vehicles_projectile_explode(this));
 }
 
 entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
@@ -265,7 +265,7 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
        proj.use                          = vehicles_projectile_explode_use;
        proj.owner                      = this;
        proj.realowner          = _owner;
-       setthink(proj, SUB_Remove_self);
+       setthink(proj, SUB_Remove);
        proj.nextthink          = time + 30;
 
        if(_health)
@@ -290,16 +290,16 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
        return proj;
 }
 
-void vehicles_gib_explode()
-{SELFPARAM();
+void vehicles_gib_explode(entity this)
+{
        sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
        Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        Send_Effect(EFFECT_EXPLOSION_SMALL, self.wp00.origin + '0 0 64', '0 0 0', 1);
        remove(self);
 }
 
-void vehicles_gib_think()
-{SELFPARAM();
+void vehicles_gib_think(entity this)
+{
        self.alpha -= 0.1;
        if(self.cnt >= time)
                remove(self);
@@ -442,7 +442,7 @@ void vehicles_clearreturn(entity veh)
                if(ret.wp00 == veh)
                {
                        ret.classname   = "";
-                       setthink(ret, SUB_Remove_self);
+                       setthink(ret, SUB_Remove);
                        ret.nextthink   = time + 0.1;
 
                        if(ret.waypointsprite_attached)
@@ -453,9 +453,9 @@ void vehicles_clearreturn(entity veh)
        }
 }
 
-void vehicles_spawn();
-void vehicles_return()
-{SELFPARAM();
+void vehicles_spawn(entity this);
+void vehicles_return(entity this)
+{
        Send_Effect(EFFECT_TELEPORT, self.wp00.origin + '0 0 64', '0 0 0', 1);
 
        setthink(self.wp00, vehicles_spawn);
@@ -467,8 +467,8 @@ void vehicles_return()
        remove(self);
 }
 
-void vehicles_showwp_goaway()
-{SELFPARAM();
+void vehicles_showwp_goaway(entity this)
+{
        if(self.waypointsprite_attached)
                WaypointSprite_Kill(self.waypointsprite_attached);
 
@@ -476,8 +476,8 @@ void vehicles_showwp_goaway()
 
 }
 
-void vehicles_showwp()
-{SELFPARAM();
+void vehicles_showwp(entity this)
+{
        vector rgb;
 
        entity ent = this;
@@ -585,8 +585,8 @@ void vehicles_regen(entity this, float timer, .float regen_field, float field_ma
        }
 }
 
-void shieldhit_think()
-{SELFPARAM();
+void shieldhit_think(entity this)
+{
        self.alpha -= 0.1;
        if (self.alpha <= 0)
        {
@@ -901,8 +901,8 @@ void vehicles_exit(bool eject)
        vehicles_exit_running = false;
 }
 
-void vehicles_touch()
-{SELFPARAM();
+void vehicles_touch(entity this)
+{
        if(MUTATOR_CALLHOOK(VehicleTouch, self, other))
                return;
 
@@ -1089,8 +1089,8 @@ void vehicles_enter(entity pl, entity veh)
        antilag_clear(pl, CS(pl));
 }
 
-void vehicles_think()
-{SELFPARAM();
+void vehicles_think(entity this)
+{
        self.nextthink = time;
 
        if(self.owner)
@@ -1105,8 +1105,8 @@ void vehicles_think()
 }
 
 // initialization
-void vehicles_spawn()
-{SELFPARAM();
+void vehicles_spawn(entity this)
+{
        LOG_TRACE("Spawning vehicle: ", self.classname, "\n");
 
        // disown & reset
index 72a70cf41e32a25f89db60c8c171530610709625..945c0964f4f5c8ab54a0f871d0ec3058b63a4002 100644 (file)
@@ -369,13 +369,13 @@ bool vehicles_valid_pilot()
        return true;
 }
 
-void bumblebee_touch()
-{SELFPARAM();
+void bumblebee_touch(entity this)
+{
        if(autocvar_g_vehicles_enter) { return; }
 
        if(self.gunner1 != world && self.gunner2 != world)
        {
-               vehicles_touch();
+               vehicles_touch(self);
                return;
        }
 
@@ -388,7 +388,7 @@ void bumblebee_touch()
                        return;
        }
 
-       vehicles_touch();
+       vehicles_touch(self);
 }
 
 void bumblebee_regen(entity this)
@@ -625,8 +625,8 @@ bool bumblebee_pilot_frame(entity this)
        PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
 }
 
-void bumblebee_land()
-{SELFPARAM();
+void bumblebee_land(entity this)
+{
        float hgt;
 
        hgt = raptor_altitude(512);
@@ -685,8 +685,8 @@ void bumblebee_exit(float eject)
        self.owner = world;
 }
 
-void bumblebee_blowup()
-{SELFPARAM();
+void bumblebee_blowup(entity this)
+{
        RadiusDamage(self, self.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage,
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
                                 autocvar_g_vehicle_bumblebee_blowup_radius, self, world,
@@ -702,8 +702,8 @@ void bumblebee_blowup()
        remove(self);
 }
 
-void bumblebee_diethink()
-{SELFPARAM();
+void bumblebee_diethink(entity this)
+{
        if(time >= self.wait)
                setthink(self, bumblebee_blowup);
 
@@ -751,7 +751,7 @@ METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance))
                entity oldother = other;
                other = e;
                self.phase = 0;
-               gettouch(self)();
+               gettouch(self)(self);
                other = oldother;
                return;
         }
@@ -763,7 +763,7 @@ METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance))
                entity oldother = other;
                other = e;
                self.phase = 0;
-               gettouch(self)();
+               gettouch(self)(self);
                other = oldother;
             return;
         }
index 6eb064af30055c7561a27c69a4f0a3e8426353c0..bcbe5be702cc799a2437dc6def3a8826fb446e4e 100644 (file)
@@ -403,8 +403,8 @@ bool racer_frame(entity this)
        this.velocity = vehic.velocity;
 }
 
-void racer_think()
-{SELFPARAM();
+void racer_think(entity this)
+{
        this.nextthink = time + autocvar_g_vehicle_racer_thinkrate;
 
        tracebox(this.origin, this.mins, this.maxs, this.origin - ('0 0 1' * autocvar_g_vehicle_racer_springlength), MOVE_NOMONSTERS, this);
@@ -501,8 +501,8 @@ void racer_blowup()
        setorigin(self, self.pos1);
 }
 
-void racer_blowup_think()
-{SELFPARAM();
+void racer_blowup_think(entity this)
+{
        self.nextthink = time;
 
        if(time >= self.delay)
@@ -511,8 +511,8 @@ void racer_blowup_think()
        CSQCMODEL_AUTOUPDATE(self);
 }
 
-void racer_deadtouch()
-{SELFPARAM();
+void racer_deadtouch(entity this)
+{
        self.avelocity_x *= 0.7;
        self.cnt -= 1;
        if(self.cnt <= 0)
index 5718d41250d9e084ecd057f20166f37e693efafc..f15b8cfb8a74ddfe092069e651355dbd0bc5dc27 100644 (file)
@@ -42,8 +42,8 @@ METHOD(RacerAttack, wr_checkammo1, bool(RacerAttack thiswep, entity actor))
     return isPlayer || veh.vehicle_energy >= autocvar_g_vehicle_racer_cannon_cost;
 }
 
-void racer_rocket_tracker();
-void racer_rocket_groundhugger();
+void racer_rocket_tracker(entity this);
+void racer_rocket_groundhugger(entity this);
 
 void racer_fire_rocket(entity player, vector org, vector dir, entity trg)
 {
@@ -64,8 +64,8 @@ void racer_fire_rocket(entity player, vector org, vector dir, entity trg)
         setthink(rocket, racer_rocket_groundhugger);
 }
 
-void racer_rocket_tracker()
-{SELFPARAM();
+void racer_rocket_tracker(entity this)
+{
     vector olddir, newdir;
     float oldvel, newvel;
 
@@ -116,8 +116,8 @@ void racer_rocket_tracker()
     return;
 }
 
-void racer_rocket_groundhugger()
-{SELFPARAM();
+void racer_rocket_groundhugger(entity this)
+{
     vector olddir, newdir;
     float oldvel, newvel;
 
index e62f033331c6f6adc2aa112b2831073336a21b0f..3a2401989fb381b3d9b089d3824b030c9cc74678 100644 (file)
@@ -83,8 +83,8 @@ float raptor_altitude(float amax)
        return vlen(self.origin - trace_endpos);
 }
 
-void raptor_land()
-{SELFPARAM();
+void raptor_land(entity this)
+{
        float hgt;
 
        hgt = raptor_altitude(512);
@@ -520,8 +520,8 @@ bool raptor_takeoff(entity this)
        PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
 }
 
-void raptor_blowup()
-{SELFPARAM();
+void raptor_blowup(entity this)
+{
        self.deadflag   = DEAD_DEAD;
        self.vehicle_exit(VHEF_NORMAL);
        RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH.m_id, world);
@@ -538,8 +538,8 @@ void raptor_blowup()
        self.nextthink = 0;
 }
 
-void raptor_diethink()
-{SELFPARAM();
+void raptor_diethink(entity this)
+{
        if(time >= self.wait)
                setthink(self, raptor_blowup);
 
@@ -555,8 +555,8 @@ void raptor_diethink()
 
 // If we dont do this ever now and then, the raptors rotors
 // stop working, presumably due to angle overflow. cute.
-void raptor_rotor_anglefix()
-{SELFPARAM();
+void raptor_rotor_anglefix(entity this)
+{
        self.gun1.angles_y = anglemods(self.gun1.angles_y);
        self.gun2.angles_y = anglemods(self.gun2.angles_y);
        self.nextthink = time + 15;
index 8eabe1cdd4b410f0ed3112d616e980cd5bbc17cd..c2c266f00535844e6a4f3b9be2a760c98b93ad89 100644 (file)
@@ -51,9 +51,9 @@ METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponen
     }
 }
 
-void raptor_flare_think();
+void raptor_flare_think(entity this);
 void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
-void raptor_flare_touch();
+void raptor_flare_touch(entity this);
 
 METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
@@ -85,8 +85,8 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
 }
 
 
-void raptor_bomblet_boom()
-{SELFPARAM();
+void raptor_bomblet_boom(entity this)
+{
     RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
                                     autocvar_g_vehicle_raptor_bomblet_radius, world, world,
@@ -94,8 +94,8 @@ void raptor_bomblet_boom()
     remove(self);
 }
 
-void raptor_bomblet_touch()
-{SELFPARAM();
+void raptor_bomblet_touch(entity this)
+{
     if(other == self.owner)
         return;
 
@@ -104,8 +104,8 @@ void raptor_bomblet_touch()
     self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
 }
 
-void raptor_bomb_burst()
-{SELFPARAM();
+void raptor_bomb_burst(entity this)
+{
     if(self.cnt > time)
     if(autocvar_g_vehicle_raptor_bomblet_alt)
     {
@@ -180,8 +180,8 @@ void raptor_bombdrop()
     CSQCProjectile(bomb_2, true, PROJECTILE_RAPTORBOMB, true);
 }
 
-void raptor_flare_touch()
-{SELFPARAM();
+void raptor_flare_touch(entity this)
+{
     remove(self);
 }
 
@@ -192,8 +192,8 @@ void raptor_flare_damage(entity this, entity inflictor, entity attacker, float d
         remove(this);
 }
 
-void raptor_flare_think()
-{SELFPARAM();
+void raptor_flare_think(entity this)
+{
     self.nextthink = time + 0.1;
     entity _missile = findchainentity(enemy, self.owner);
     while(_missile)
index e60b263a6458c3e8aad219ca3932c3e129a390ef..1b27587398d00c89507efd6e67cec59ebd32e3a3 100644 (file)
@@ -392,8 +392,8 @@ void spiderbot_exit(float eject)
        self.owner = world;
 }
 
-void spiderbot_headfade()
-{SELFPARAM();
+void spiderbot_headfade(entity this)
+{
        setthink(self, spiderbot_headfade);
        self.nextthink = self.fade_time;
        self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
@@ -409,8 +409,8 @@ void spiderbot_headfade()
        }
 }
 
-void spiderbot_blowup()
-{SELFPARAM();
+void spiderbot_blowup(entity this)
+{
        if(self.cnt > time)
        {
                if(random() < 0.1)
index 405a2ac8d17afe31b32821fe794de265deefe773..ae8c6c6f982ed156f10d2234773080eedb824d22 100644 (file)
@@ -10,8 +10,8 @@ void spiderbot_rocket_artillery()
     UpdateCSQCProjectile(self);
 }
 
-void spiderbot_rocket_unguided()
-{SELFPARAM();
+void spiderbot_rocket_unguided(entity this)
+{
     vector newdir, olddir;
 
     self.nextthink  = time;
@@ -26,8 +26,8 @@ void spiderbot_rocket_unguided()
         self.use(self, NULL, NULL);
 }
 
-void spiderbot_rocket_guided()
-{SELFPARAM();
+void spiderbot_rocket_guided(entity this)
+{
     vector newdir, olddir;
 
     self.nextthink  = time;
index 4354cc415fd056ffc75d22d99e0708c3417a15d4..b86b77fadf4ffc0cb14de612227121f3433c2635 100644 (file)
@@ -107,14 +107,14 @@ void W_PROP_reload(int chan, entity to)
         if (f) f(it, chan);
     });
 }
-void W_PROP_think()
+void W_PROP_think(entity this)
 {
     W_PROP_reload(MSG_ALL, NULL);
 }
 STATIC_INIT_LATE(W_PROP_reloader)
 {
     entity e = W_PROP_reloader = new_pure(W_PROP_reloader);
-    WITHSELF(e, (setthink(e, W_PROP_think))());
+    WITHSELF(e, (setthink(e, W_PROP_think))(e));
 }
 #endif
 
index 46efc1fae8e7456827fd1f0f31ede46f32a74892..462bf0aa312e32cc375b1bfcbf3f5d4a03a3289f 100644 (file)
@@ -259,8 +259,8 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam
                W_PrepareExplosionByDamage(this, attacker, getthink(this));
 }
 
-void W_Arc_Bolt_Touch()
-{SELFPARAM();
+void W_Arc_Bolt_Touch(entity this)
+{
        PROJECTILE_TOUCH;
        self.use(this, NULL, NULL);
 }
@@ -307,8 +307,8 @@ void W_Arc_Attack_Bolt(Weapon thiswep)
        MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
-void W_Arc_Beam_Think()
-{SELFPARAM();
+void W_Arc_Beam_Think(entity this)
+{
        if(self != self.owner.arc_beam)
        {
                remove(self);
@@ -691,7 +691,7 @@ void W_Arc_Beam(float burst)
        beam.beam_bursting = burst;
        Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
 
-       WITHSELF(beam, getthink(beam)());
+       WITHSELF(beam, getthink(beam)(beam));
 }
 
 void Arc_Smoke()
index 08b5e3472cbbdea214fdae16fcffe5b88560d8b2..4da4f826727ec2d01b033af6bfd2292c7e1eb1bf 100644 (file)
@@ -56,8 +56,8 @@ REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
 spawnfunc(weapon_blaster) { weapon_defaultspawnfunc(this, WEP_BLASTER); }
 spawnfunc(weapon_laser) { spawnfunc_weapon_blaster(this); }
 
-void W_Blaster_Touch()
-{SELFPARAM();
+void W_Blaster_Touch(entity this)
+{
        PROJECTILE_TOUCH;
 
        self.event_damage = func_null;
@@ -78,10 +78,10 @@ void W_Blaster_Touch()
        remove(self);
 }
 
-void W_Blaster_Think()
-{SELFPARAM();
+void W_Blaster_Think(entity this)
+{
        this.movetype = MOVETYPE_FLY;
-       setthink(this, SUB_Remove_self);
+       setthink(this, SUB_Remove);
        this.nextthink = time + this.blaster_lifetime;
        CSQCProjectile(this, true, PROJECTILE_BLASTER, true);
 }
@@ -146,7 +146,7 @@ void W_Blaster_Attack(
 
        if (time >= missile.nextthink)
        {
-               WITHSELF(missile, getthink(missile)());
+               WITHSELF(missile, getthink(missile)(missile));
        }
 }
 
index 0d704da2463637701c4a696262c3f8b74bca4acf..7c9ae5eaf0272452e3ee06f4df3ca3f479ad82aa 100644 (file)
@@ -228,8 +228,8 @@ vector W_Crylink_LinkJoin(entity e, float jspeed)
        return targ_origin;
 }
 
-void W_Crylink_LinkJoinEffect_Think()
-{SELFPARAM();
+void W_Crylink_LinkJoinEffect_Think(entity this)
+{
        // is there at least 2 projectiles very close?
        entity e, p;
        float n;
@@ -293,8 +293,8 @@ float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
 }
 
 // NO bounce protection, as bounces are limited!
-void W_Crylink_Touch()
-{SELFPARAM();
+void W_Crylink_Touch(entity this)
+{
        float finalhit;
        float f;
        float isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
@@ -338,8 +338,8 @@ void W_Crylink_Touch()
        //      CSQCProjectile(proj, true, PROJECTILE_CRYLINK, true);
 }
 
-void W_Crylink_Fadethink()
-{SELFPARAM();
+void W_Crylink_Fadethink(entity this)
+{
        W_Crylink_Dequeue(self);
        remove(self);
 }
index 1966509e6eb5aab8dfa298224f165cfe7b72a633..1c79e2fcb2534ae9d36e122485e0d4c233f5abc0 100644 (file)
@@ -81,8 +81,8 @@ void W_Devastator_Unregister()
        }
 }
 
-void W_Devastator_Explode()
-{SELFPARAM();
+void W_Devastator_Explode(entity this)
+{
        W_Devastator_Unregister();
 
        if(other.takedamage == DAMAGE_AIM)
@@ -252,8 +252,8 @@ vector W_Devastator_SteerTo(vector thisdir, vector goaldir, float maxturn_cos)
 //   normalize(thisdir + goaldir)
 //   normalize(0)
 
-void W_Devastator_Think()
-{SELFPARAM();
+void W_Devastator_Think(entity this)
+{
        vector desireddir, olddir, newdir, desiredorigin, goal;
        float velspeed, f;
        self.nextthink = time;
@@ -261,7 +261,7 @@ void W_Devastator_Think()
        {
                other = world;
                self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_Devastator_Explode();
+               W_Devastator_Explode(self);
                return;
        }
 
@@ -320,8 +320,8 @@ void W_Devastator_Think()
                UpdateCSQCProjectile(self);
 }
 
-void W_Devastator_Touch()
-{SELFPARAM();
+void W_Devastator_Touch(entity this)
+{
        if(WarpZone_Projectile_Touch())
        {
                if(wasfreed(self))
@@ -329,7 +329,7 @@ void W_Devastator_Touch()
                return;
        }
        W_Devastator_Unregister();
-       W_Devastator_Explode();
+       W_Devastator_Explode(this);
 }
 
 void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
index 84bef35b2779dbff132289a8ff84ad62f5e4c9b6..37711625a75064c3e8fb62aabf9cb88da9ce049e 100644 (file)
@@ -68,7 +68,7 @@ REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
 #ifdef SVQC
 .float electro_count;
 .float electro_secondarytime;
-void W_Electro_ExplodeCombo();
+void W_Electro_ExplodeCombo(entity this);
 #endif
 #endif
 #ifdef IMPLEMENTATION
@@ -122,8 +122,8 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own)
        }
 }
 
-void W_Electro_ExplodeCombo()
-{SELFPARAM();
+void W_Electro_ExplodeCombo(entity this)
+{
        W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
 
        self.event_damage = func_null;
@@ -196,14 +196,14 @@ void W_Electro_Explode_use(entity this, entity actor, entity trigger)
        WITHSELF(this, W_Electro_Explode());
 }
 
-void W_Electro_TouchExplode()
+void W_Electro_TouchExplode(entity this)
 {
        PROJECTILE_TOUCH;
        W_Electro_Explode();
 }
 
-void W_Electro_Bolt_Think()
-{SELFPARAM();
+void W_Electro_Bolt_Think(entity this)
+{
        if(time >= self.ltime)
        {
                this.use(this, NULL, NULL);
@@ -298,8 +298,8 @@ void W_Electro_Attack_Bolt(Weapon thiswep)
        MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
-void W_Electro_Orb_Touch()
-{SELFPARAM();
+void W_Electro_Orb_Touch(entity this)
+{
        PROJECTILE_TOUCH;
        if(other.takedamage == DAMAGE_AIM)
                { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(); } }
index de468896f1bf26b4500871c02a06fa0f5f4141de..9aa1d4b0781b605d25689cba0dfd182957710d8b 100644 (file)
@@ -62,8 +62,8 @@ REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
 #ifdef SVQC
 spawnfunc(weapon_fireball) { weapon_defaultspawnfunc(this, WEP_FIREBALL); }
 
-void W_Fireball_Explode()
-{SELFPARAM();
+void W_Fireball_Explode(entity this)
+{
        entity e;
        float dist;
        float points;
@@ -114,13 +114,13 @@ void W_Fireball_Explode()
 
 void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
 {
-       WITHSELF(this, W_Fireball_Explode());
+       WITHSELF(this, W_Fireball_Explode(this));
 }
 
-void W_Fireball_TouchExplode()
+void W_Fireball_TouchExplode(entity this)
 {
        PROJECTILE_TOUCH;
-       W_Fireball_Explode();
+       W_Fireball_Explode(this);
 }
 
 void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage, float burntime)
@@ -157,13 +157,13 @@ void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage,
        }
 }
 
-void W_Fireball_Think()
-{SELFPARAM();
+void W_Fireball_Think(entity this)
+{
        if(time > self.pushltime)
        {
                self.cnt = 1;
                self.projectiledeathtype |= HITTYPE_SPLASH;
-               W_Fireball_Explode();
+               W_Fireball_Explode(this);
                return;
        }
 
@@ -264,8 +264,8 @@ void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, .entity weaponentit
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
 }
 
-void W_Fireball_Firemine_Think()
-{SELFPARAM();
+void W_Fireball_Firemine_Think(entity this)
+{
        if(time > self.pushltime)
        {
                remove(self);
@@ -290,8 +290,8 @@ void W_Fireball_Firemine_Think()
        self.nextthink = time + 0.1;
 }
 
-void W_Fireball_Firemine_Touch()
-{SELFPARAM();
+void W_Fireball_Firemine_Touch(entity this)
+{
        PROJECTILE_TOUCH;
        if(other.takedamage == DAMAGE_AIM)
        if(Fire_AddDamage(other, self.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), self.projectiledeathtype) >= 0)
index 35622949c08d0cdcd6ef14522fd7bfcd4cedb5aa..d37063a6780c9bf085216b018c9afd6dd4ffa635 100644 (file)
@@ -113,14 +113,14 @@ void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage
                W_PrepareExplosionByDamage(this, attacker, getthink(this));
 }
 
-void W_Hagar_Touch()
-{SELFPARAM();
+void W_Hagar_Touch(entity this)
+{
        PROJECTILE_TOUCH;
        this.use(this, NULL, NULL);
 }
 
-void W_Hagar_Touch2()
-{SELFPARAM();
+void W_Hagar_Touch2(entity this)
+{
        PROJECTILE_TOUCH;
 
        if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
index ae005572015f4ee5c0765bb6818ed35ee575663e..dbcb04deff78d4f4211ba3792cd310c4af631c62 100644 (file)
@@ -54,8 +54,8 @@ REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
 #ifdef SVQC
 spawnfunc(weapon_hlac) { weapon_defaultspawnfunc(this, WEP_HLAC); }
 
-void W_HLAC_Touch()
-{SELFPARAM();
+void W_HLAC_Touch(entity this)
+{
        float isprimary;
 
        PROJECTILE_TOUCH;
@@ -105,7 +105,7 @@ void W_HLAC_Attack(Weapon thiswep)
        //missile.angles = vectoangles(missile.velocity); // csqc
 
        settouch(missile, W_HLAC_Touch);
-       setthink(missile, SUB_Remove_self);
+       setthink(missile, SUB_Remove);
 
     missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
 
@@ -147,7 +147,7 @@ void W_HLAC_Attack2()
        //missile.angles = vectoangles(missile.velocity); // csqc
 
        settouch(missile, W_HLAC_Touch);
-       setthink(missile, SUB_Remove_self);
+       setthink(missile, SUB_Remove);
 
     missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
 
index adb1781f60d9537fd0dd8c3077b0f5a7cdc208f6..c4529759a9800835b43ec6441b061857355dfaa7 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,8 +99,8 @@ 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;
@@ -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);
 }
index e39adb4e5e79c1e5c7a57fca00add72f6a40d24a..18934a66f35c1a2242d744bdefb5b02d21f5df2f 100644 (file)
@@ -71,8 +71,8 @@ spawnfunc(weapon_machinegun)
 }
 spawnfunc(weapon_uzi) { spawnfunc_weapon_machinegun(this); }
 
-void W_MachineGun_MuzzleFlash_Think()
-{SELFPARAM();
+void W_MachineGun_MuzzleFlash_Think(entity this)
+{
        this.frame += 2;
        this.scale *= 0.5;
        this.alpha -= 0.25;
@@ -80,7 +80,7 @@ void W_MachineGun_MuzzleFlash_Think()
 
        if(this.alpha <= 0)
        {
-               setthink(this, SUB_Remove_self);
+               setthink(this, SUB_Remove);
                this.nextthink = time;
                this.realowner.muzzle_flash = world;
                return;
index f8c3c6ca93298ded90dd9b0dd331b24f8353795f..66c6d021e4d8c7962c4f078a895c672bec1cf019 100644 (file)
@@ -53,7 +53,7 @@ ENDCLASS(MineLayer)
 REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
 
 #ifdef SVQC
-void W_MineLayer_Think();
+void W_MineLayer_Think(entity this);
 .float minelayer_detonate, mine_explodeanyway;
 .float mine_time;
 .vector mine_orientation;
@@ -108,8 +108,8 @@ void W_MineLayer_Stick(entity to)
                SetMovetypeFollow(newmine, to);
 }
 
-void W_MineLayer_Explode()
-{SELFPARAM();
+void W_MineLayer_Explode(entity this)
+{
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
@@ -192,7 +192,7 @@ void W_MineLayer_ProximityExplode()
        }
 
        self.mine_time = 0;
-       W_MineLayer_Explode();
+       W_MineLayer_Explode(self);
 }
 
 int W_MineLayer_Count(entity e)
@@ -205,8 +205,8 @@ int W_MineLayer_Count(entity e)
        return minecount;
 }
 
-void W_MineLayer_Think()
-{SELFPARAM();
+void W_MineLayer_Think(entity this)
+{
        entity head;
 
        self.nextthink = time;
@@ -236,7 +236,7 @@ void W_MineLayer_Think()
        {
                other = world;
                self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_MineLayer_Explode();
+               W_MineLayer_Explode(self);
                return;
        }
 
@@ -268,8 +268,8 @@ void W_MineLayer_Think()
                W_MineLayer_RemoteExplode();
 }
 
-void W_MineLayer_Touch()
-{SELFPARAM();
+void W_MineLayer_Touch(entity this)
+{
        if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
                return; // we're already a stuck mine, why do we get called? TODO does this even happen?
 
index b264fab0033c32824738c5b26e18b3165b652504..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,8 +142,8 @@ 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
        {
@@ -174,8 +174,8 @@ 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
        {
index bef792cc533227edf82e95c705c3afb377aeb88c..d1bd519eecd4d18d9c8107b38692c5661432bdf6 100644 (file)
@@ -109,8 +109,8 @@ void W_Porto_Remove(entity p)
        }
 }
 
-void W_Porto_Think()
-{SELFPARAM();
+void W_Porto_Think(entity this)
+{
        trace_plane_normal = '0 0 0';
        if(self.realowner.playerid != self.playerid)
                remove(self);
@@ -118,8 +118,8 @@ void W_Porto_Think()
                W_Porto_Fail(0);
 }
 
-void W_Porto_Touch()
-{SELFPARAM();
+void W_Porto_Touch(entity this)
+{
        vector norm;
 
        // do not use PROJECTILE_TOUCH here
index 2e98fdbe3c8d0f8337e60a003d9e741e464b6454..d1a9368142edbe24640be51cee3c15f54f468fed 100644 (file)
@@ -94,23 +94,23 @@ spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); }
 // ============================
 // Begin: Missile functions, these are general functions to be manipulated by other code
 // ============================
-void W_Seeker_Missile_Explode()
-{SELFPARAM();
+void W_Seeker_Missile_Explode(entity this)
+{
        self.event_damage = func_null;
        RadiusDamage(self, self.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), self.projectiledeathtype, other);
 
        remove(self);
 }
 
-void W_Seeker_Missile_Touch()
+void W_Seeker_Missile_Touch(entity this)
 {
        PROJECTILE_TOUCH;
 
-       W_Seeker_Missile_Explode();
+       W_Seeker_Missile_Explode(this);
 }
 
-void W_Seeker_Missile_Think()
-{SELFPARAM();
+void W_Seeker_Missile_Think(entity this)
+{
        entity e;
        vector desireddir, olddir, newdir, eorg;
        float turnrate;
@@ -120,7 +120,7 @@ void W_Seeker_Missile_Think()
        if(time > self.cnt)
        {
                self.projectiledeathtype |= HITTYPE_SPLASH;
-               W_Seeker_Missile_Explode();
+               W_Seeker_Missile_Explode(self);
        }
 
        spd = vlen(self.velocity);
@@ -178,7 +178,7 @@ void W_Seeker_Missile_Think()
                        {
                                if(self.autoswitch <= time)
                                {
-                                       W_Seeker_Missile_Explode();
+                                       W_Seeker_Missile_Explode(self);
                                        self.autoswitch = 0;
                                }
                        }
@@ -304,8 +304,8 @@ void W_Seeker_Fire_Missile(Weapon thiswep, vector f_diff, entity m_target)
 // ============================
 // Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
 // ============================
-void W_Seeker_Flac_Explode()
-{SELFPARAM();
+void W_Seeker_Flac_Explode(entity this)
+{
        self.event_damage = func_null;
 
        RadiusDamage(self, self.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), self.projectiledeathtype, other);
@@ -315,14 +315,15 @@ void W_Seeker_Flac_Explode()
 
 void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
 {
-       WITHSELF(this, W_Seeker_Flac_Explode());
+       WITHSELF(this, W_Seeker_Flac_Explode(this));
 }
 
 void W_Seeker_Flac_Touch()
 {
+    SELFPARAM();
        PROJECTILE_TOUCH;
 
-       W_Seeker_Flac_Explode();
+       W_Seeker_Flac_Explode(this);
 }
 
 void W_Seeker_Fire_Flac(Weapon thiswep)
@@ -419,8 +420,8 @@ void W_Seeker_Attack()
        W_Seeker_Fire_Missile(WEP_SEEKER, '0 0 0', closest_target);
 }
 
-void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
-{SELFPARAM();
+void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
+{
        float c;
        entity oldenemy;
        this.cnt = this.cnt - 1;
@@ -460,8 +461,8 @@ void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
        own.enemy = oldenemy;
 }
 
-void W_Seeker_Tracker_Think()
-{SELFPARAM();
+void W_Seeker_Tracker_Think(entity this)
+{
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
        if((IS_DEAD(self.realowner)) || (IS_DEAD(self.tag_target)) || (PS(self.realowner).m_switchweapon != WEP_SEEKER)
        || (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
@@ -499,8 +500,8 @@ void W_Seeker_Tag_Damage(entity this, entity inflictor, entity attacker, float d
                W_Seeker_Tag_Explode(this);
 }
 
-void W_Seeker_Tag_Touch()
-{SELFPARAM();
+void W_Seeker_Tag_Touch(entity this)
+{
        vector dir;
        vector org2;
        entity e;
@@ -573,7 +574,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep)
        missile.bot_dodge       = true;
        missile.bot_dodgerating = 50;
        settouch(missile, W_Seeker_Tag_Touch);
-       setthink(missile, SUB_Remove_self);
+       setthink(missile, SUB_Remove);
        missile.nextthink       = time + WEP_CVAR(seeker, tag_lifetime);
        missile.movetype        = MOVETYPE_FLY;
        missile.solid           = SOLID_BBOX;
index 3b6266f6ed6af510079d64153327d2012085c0de..47d33fc5e56e873095ea8948ea2a47b361a6ebb2 100644 (file)
@@ -112,8 +112,8 @@ float shockwave_hit_damage[MAX_SHOCKWAVE_HITS];
 vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
 
 // MELEE ATTACK MODE
-void W_Shockwave_Melee_Think()
-{SELFPARAM();
+void W_Shockwave_Melee_Think(entity this)
+{
        // declarations
        float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
        entity target_victim;
index 361f70a84365345d48291b5bf358aaeda6b0b152..1cf1fe07f0c36b5dceaf5fc3de37a4163b3f9ecd 100644 (file)
@@ -79,7 +79,7 @@ void W_Shotgun_Attack(Weapon thiswep, float isprimary)
        // muzzle flash for 1st person view
        flash = spawn();
        setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below
-       setthink(flash, SUB_Remove_self);
+       setthink(flash, SUB_Remove);
        flash.nextthink = time + 0.06;
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        W_AttachToShotorg(self, flash, '5 0 0');
@@ -87,8 +87,8 @@ void W_Shotgun_Attack(Weapon thiswep, float isprimary)
 
 .float swing_prev;
 .entity swing_alreadyhit;
-void W_Shotgun_Melee_Think()
-{SELFPARAM();
+void W_Shotgun_Melee_Think(entity this)
+{
        // declarations
        float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
        entity target_victim;
index 3f1aca6661fd73dcdb6ca20947a971eebf995060..1c0a5bb8ef7ac4db71bdd06cfc9369929374b50f 100644 (file)
@@ -274,8 +274,8 @@ bool W_Tuba_NoteSendEntity(entity this, entity to, int sf)
        return true;
 }
 
-void W_Tuba_NoteThink()
-{SELFPARAM();
+void W_Tuba_NoteThink(entity this)
+{
        float dist_mult;
        float vol0, vol1;
        vector dir0, dir1;
@@ -552,8 +552,8 @@ void tubasound(entity e, bool restart)
        }
 }
 
-void Ent_TubaNote_Think()
-{SELFPARAM();
+void Ent_TubaNote_Think(entity this)
+{
        float f = autocvar_g_balance_tuba_fadetime;
        if (f > 0) {
                this.tuba_volume -= frametime * this.tuba_volume_initial / f;
@@ -588,8 +588,6 @@ void Ent_TubaNote_StopSound(entity this)
        this.enemy = NULL;
 }
 
-void Ent_TubaNote_StopSound_self() { SELFPARAM(); Ent_TubaNote_StopSound(self); }
-
 NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
 {
        bool upd = false;
@@ -631,7 +629,7 @@ NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
                }
        }
 
-       setthink(this, Ent_TubaNote_StopSound_self);
+       setthink(this, Ent_TubaNote_StopSound);
        this.entremove = Ent_TubaNote_StopSound;
        setthink(this.enemy, Ent_TubaNote_Think);
        this.enemy.nextthink = time + 10;
index 320f0e46c9a3a61e173f3d1be17280bac8137d7b..d0125ed342fb3a014935beb77756fd0e4644520e 100644 (file)
@@ -137,7 +137,7 @@ void VaporizerBeam_Draw(entity this)
 NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
 {
        Net_Accept(vortex_beam);
-       setthink(this, SUB_Remove_self);
+       setthink(this, SUB_Remove);
        this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10);
        this.draw = VaporizerBeam_Draw;
        this.drawmask = MASK_NORMAL;
@@ -232,8 +232,8 @@ void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
        WITHSELF(this, W_RocketMinsta_Laser_Explode());
 }
 
-void W_RocketMinsta_Laser_Touch ()
-{SELFPARAM();
+void W_RocketMinsta_Laser_Touch (entity this)
+{
        PROJECTILE_TOUCH;
        //W_RocketMinsta_Laser_Explode ();
        RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other);
index d56895dcae4e4ab76f7c6947690e5a6bcf6db872..d4a25089fc5a2bf88eddee18ccb51a91e6e85830 100644 (file)
                remove(this);
        }
 
-       /** Remove self */
-       void SUB_Remove_self()
-       {
-               SELFPARAM();
-               remove(this);
-       }
-
-       void defer_think()
+       void defer_think(entity this)
        {
-               SELFPARAM();
-               setthink(this, SUB_Remove_self);
+               setthink(this, SUB_Remove);
                this.nextthink = time;
                this.defer_func(this.owner);
        }
index 49f778a5259de4acc197591f3ffc66c35884a1f7..f0a9cc282dc4d24d28a7abb3d8b9097af3f0a982 100644 (file)
@@ -124,7 +124,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                if (dt)
                {
                        e.nextthink = time + dt;
-                       setthink(e, SUB_Remove_self);
+                       setthink(e, SUB_Remove);
                }
        }
 
index da85a2adc9e20d8f1366cc213c45ef928578eab8..50196a03a97d4f614725faa16113d3fdcbc207ab 100644 (file)
@@ -62,17 +62,17 @@ noref entity _selftemp;
     (0, (e).__##T)
 
 SELFWRAP(think, void, (entity this), (this))
-#define setthink(e, f) _SELFWRAP_SET(think, e, f)
-#define getthink(e) _SELFWRAP_GET(think, e)
+#define setthink(e, f) SELFWRAP_SET(think, e, f)
+#define getthink(e) SELFWRAP_GET(think, e)
 
 SELFWRAP(touch, void, (entity this), (this))
-#define settouch(e, f) _SELFWRAP_SET(touch, e, f)
-#define gettouch(e) _SELFWRAP_GET(touch, e)
+#define settouch(e, f) SELFWRAP_SET(touch, e, f)
+#define gettouch(e) SELFWRAP_GET(touch, e)
 
 SELFWRAP(predraw, void, (entity this), (this))
 #define setpredraw(e, f) SELFWRAP_SET(predraw, e, f)
 
 #ifndef MENUQC
-void adaptor_think2touch() { SELFPARAM(); WITH(entity, other, NULL, gettouch(this)()); }
-void adaptor_think2use() { SELFPARAM(); if (this.use) this.use(this, NULL, NULL); }
+void adaptor_think2touch(entity this) { WITH(entity, other, NULL, gettouch(this)(this)); }
+void adaptor_think2use(entity this) { if (this.use) this.use(this, NULL, NULL); }
 #endif
index 6467dad35a4d57b4fcebe762166b70216ef2fbec..04f037826ee2c7cd351378ed8cf2ee83a0f6d52b 100644 (file)
@@ -25,7 +25,7 @@ void WarpZone_Fade_PreDraw(entity this)
                this.drawmask = MASK_NORMAL;
 }
 
-void WarpZone_Touch ();
+void WarpZone_Touch (entity this);
 NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
 {
        warpzone_warpzones_exist = 1;
index d3d7250e856974977f6501d1550d1256eb81afc0..5967c1ba1a9d564db61f3bf52a6137ee9616387a 100644 (file)
@@ -667,8 +667,8 @@ entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
 }
 
 .entity WarpZone_refsys;
-void WarpZone_RefSys_GC()
-{SELFPARAM();
+void WarpZone_RefSys_GC(entity this)
+{
        // garbage collect unused reference systems
        this.nextthink = time + 1;
        if(this.owner.WarpZone_refsys != this)
index 9bc39463e1b9881731c4412c8be8274c520ab45c..c8a241f97dd82e680234403cd9142acea6fbe7aa 100644 (file)
@@ -173,7 +173,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
                ts.SendEntity3 = WarpZone_Teleported_Send;
                ts.SendFlags = 0xFFFFFF;
                ts.drawonlytoclient = player;
-               setthink(ts, SUB_Remove_self);
+               setthink(ts, SUB_Remove);
                ts.nextthink = time + 1;
                ts.owner = player;
                ts.enemy = wz;
@@ -190,8 +190,8 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
        return 1;
 }
 
-void WarpZone_Touch ()
-{SELFPARAM();
+void WarpZone_Touch (entity this)
+{
        if(other.classname == "trigger_warpzone")
                return;
 
@@ -543,8 +543,8 @@ void WarpZonePosition_InitStep_FindTarget(entity this)
        this.enemy.aiment = this;
 }
 
-void WarpZoneCamera_Think()
-{SELFPARAM();
+void WarpZoneCamera_Think(entity this)
+{
        if(this.warpzone_save_origin != this.origin
        || this.warpzone_save_angles != this.angles
        || this.warpzone_save_eorigin != this.enemy.origin
@@ -708,7 +708,7 @@ void WarpZone_InitStep_FindTarget(entity this)
        }
 }
 
-void WarpZone_Think();
+void WarpZone_Think(entity this);
 void WarpZone_InitStep_FinalizeTransform(entity this)
 {
        if(!this.enemy || this.enemy.enemy != this)
@@ -817,8 +817,8 @@ void WarpZones_Reconnect()
                WarpZone_InitStep_FinalizeTransform(e);
 }
 
-void WarpZone_Think()
-{SELFPARAM();
+void WarpZone_Think(entity this)
+{
        if(this.warpzone_save_origin != this.origin
        || this.warpzone_save_angles != this.angles
        || this.warpzone_save_eorigin != this.enemy.origin
index 2f0b425399560f77a4df0efe89d322a5a874cc7f..ef8451efac92beea85914831f58ae0ad8a9433eb 100644 (file)
@@ -163,8 +163,8 @@ void waypoint_addlink(entity from, entity to)
 // relink this spawnfunc_waypoint
 // (precompile a list of all reachable waypoints from this spawnfunc_waypoint)
 // (SLOW!)
-void waypoint_think()
-{SELFPARAM();
+void waypoint_think(entity this)
+{
        entity e;
        vector sv, sm1, sm2, ev, em1, em2, dv;
 
index a03155544f6688722ef8e3f462ae50f4531226a2..23c0fa63c3b66a4c168a7bbb5cd12b55fc55c77a 100644 (file)
@@ -39,7 +39,7 @@ float botframe_cachedwaypointlinks;
 
 spawnfunc(waypoint);
 void waypoint_addlink(entity from, entity to);
-void waypoint_think();
+void waypoint_think(entity this);
 void waypoint_clearlinks(entity wp);
 void waypoint_schedulerelink(entity wp);
 
index 55440ca8c0be2615903fcc7039a96dad8d32bd1f..b9928f0b91213da871dbd68baacb0c3c7dd5f46f 100644 (file)
@@ -284,7 +284,7 @@ float CheatImpulse(entity this, int imp)
        END_CHEAT_FUNCTION();
 }
 
-void DragBox_Think();
+void DragBox_Think(entity this);
 float drag_lastcnt;
 float CheatCommand(entity this, int argc)
 {
@@ -1040,8 +1040,8 @@ void Drag_MoveDrag(entity from, entity to)
        }
 }
 
-void DragBox_Think()
-{SELFPARAM();
+void DragBox_Think(entity this)
+{
        if(this.aiment && this.enemy)
        {
                this.origin_x = (this.aiment.origin.x + this.enemy.origin.x) * 0.5;
index 4dd0c2f767e459b86093a1cf57e97f361ffd53b7..e9fbdbdc865db312736cdf14eaf945402ed81946 100644 (file)
@@ -696,8 +696,8 @@ void ClientInit_misc(entity this)
        WriteCoord(channel, autocvar_g_trueaim_minrange);
 }
 
-void ClientInit_CheckUpdate()
-{SELFPARAM();
+void ClientInit_CheckUpdate(entity this)
+{
        this.nextthink = time;
        if(this.count != autocvar_g_balance_armor_blockpercent)
        {
@@ -712,7 +712,7 @@ void ClientInit_Spawn()
        setthink(e, ClientInit_CheckUpdate);
        Net_LinkEntity(e, false, 0, ClientInit_SendEntity);
 
-       WITHSELF(e, ClientInit_CheckUpdate());
+       WITHSELF(e, ClientInit_CheckUpdate(e));
 }
 
 /*
@@ -810,8 +810,8 @@ void ClientKill_Now()
 
        // now I am sure the player IS dead
 }
-void KillIndicator_Think()
-{SELFPARAM();
+void KillIndicator_Think(entity this)
+{
        if (gameover)
        {
                this.owner.killindicator = world;
@@ -1222,8 +1222,8 @@ void ClientDisconnect()
        if (vote_called && IS_REAL_CLIENT(this)) VoteCount(false);
 }
 
-void ChatBubbleThink()
-{SELFPARAM();
+void ChatBubbleThink(entity this)
+{
        this.nextthink = time;
        if ((this.owner.alpha < 0) || this.owner.chatbubbleentity != this)
        {
index 5722934f8e93afd4ebc366c3991879a06d600ad3..b1ca51987ae648ea8c3ad8dca6ca08086298a442 100644 (file)
@@ -37,11 +37,11 @@ void Drop_Special_Items(entity player)
        MUTATOR_CALLHOOK(DropSpecialItems, player);
 }
 
-void CopyBody_Think()
-{SELFPARAM();
+void CopyBody_Think(entity this)
+{
        if(this.CopyBody_nextthink && time > this.CopyBody_nextthink)
        {
-               this.CopyBody_think();
+               this.CopyBody_think(this);
                if(wasfreed(this))
                        return;
                this.CopyBody_nextthink = this.nextthink;
index 22c595f66d3cd9ca4a59ce2e507e0d9f65dc2524..16637fe327415e86ff4f5205322008cf55451ec1 100644 (file)
@@ -5,8 +5,8 @@
 .float istypefrag;
 
 .float CopyBody_nextthink;
-.void() CopyBody_think;
-void CopyBody_Think();
+.void(entity this) CopyBody_think;
+void CopyBody_Think(entity this);
 void CopyBody(entity this, float keepvelocity);
 
 void player_setupanimsformodel();
index a798f286644588d8057d98ab83ef0c8e291a740f..5bacd0d87c14f7e6757a0e7d2337b16055e5a1a9 100644 (file)
@@ -193,9 +193,8 @@ void timeout_handler_reset()
        remove(self);
 }
 
-void timeout_handler_think()
+void timeout_handler_think(entity this)
 {
-       SELFPARAM();
        switch (timeout_status)
        {
                case TIMEOUT_ACTIVE:
index b79a570209ff46f7c0f2a10f73634443034cc0d3..a45d91343f255e0ccd88240fc39a6e9cd2bc6c7c 100644 (file)
@@ -55,7 +55,7 @@ float timeout_status;    // (values: 0, 1, 2) contains whether a timeout is not
 .vector lastV_angle;     // used when pausing the game in order to force the player to keep his old view angle fixed
 
 // allow functions to be used in other code like g_world.qc and teamplay.qc
-void timeout_handler_think();
+void timeout_handler_think(entity this);
 
 // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
 void CommonCommand_macro_write_aliases(float fh);
@@ -100,7 +100,7 @@ void print_to(entity to, string input);
 // used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such.
 void timeout_handler_reset();
 
-void timeout_handler_think();
+void timeout_handler_think(entity this);
 
 // ===================================================
 //  Common commands used in both sv_cmd.qc and cmd.qc
index 138657b885efb99452da05c75b5ebb316bc85d44..616727c5d66b5ad1acb63b46b5eee79f1e69f2ae 100644 (file)
@@ -210,9 +210,8 @@ void RadarMap_Next()
        remove(radarmapper);
        radarmapper = world;
 }
-void RadarMap_Think()
+void RadarMap_Think(entity this)
 {
-       SELFPARAM();
        // rough map entity
        //   cnt: current line
        //   size: pixel width/height
index bc530b9bce44fa6d4b27e40a148d6b9c97c18d12..f056f0ff2f64533954fff7a98651c6b4fc52ec27 100644 (file)
@@ -39,9 +39,8 @@ void PutObserverInServer();
 // =====================================================
 
 //  used by GameCommand_make_mapinfo()
-void make_mapinfo_Think()
+void make_mapinfo_Think(entity this)
 {
-       SELFPARAM();
        if (MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
        {
                LOG_INFO("Done rebuiling mapinfos.\n");
index 15d27a3ee4dabc3528a769062d32be456c13ceb2..982e55c9619ac9578d03c421421bfc5dc873aa58 100644 (file)
@@ -387,9 +387,8 @@ void reset_map(bool dorespawn)
 }
 
 // Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
-void ReadyRestart_think()
+void ReadyRestart_think(entity this)
 {
-       SELFPARAM();
        restart_mapalreadyrestarted = true;
        reset_map(true);
        Score_ClearAll();
index 6081b5ba986c8fe949795250bb7ded4a12fa9591..730dad620b2d8818eec2ad8ba7a8bd00eeebd504 100644 (file)
@@ -501,8 +501,8 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
        if(targ.killcount) { targ.killcount = 0; }
 }
 
-void Ice_Think()
-{SELFPARAM();
+void Ice_Think(entity this)
+{
        if(!STAT(FROZEN, self.owner) || self.owner.iceblock != self)
        {
                remove(self);
@@ -541,7 +541,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.iceblock = ice;
        targ.revival_time = 0;
 
-       WITHSELF(ice, Ice_Think());
+       WITHSELF(ice, Ice_Think(ice));
 
        RemoveGrapplingHook(targ);
 
@@ -850,7 +850,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        farcent.origin = hitloc;
                        farcent.forcetype = FORCETYPE_FORCEATPOS;
                        farcent.nextthink = time + 0.1;
-                       setthink(farcent, SUB_Remove_self);
+                       setthink(farcent, SUB_Remove);
                }
                else
                {
@@ -1251,8 +1251,8 @@ void Fire_ApplyEffect(entity e)
                e.effects &= ~EF_FLAME;
 }
 
-void fireburner_think()
-{SELFPARAM();
+void fireburner_think(entity this)
+{
        // for players, this is done in the regular loop
        if(wasfreed(self.owner))
        {
index ca5c45b9efd3c01282d965cd812abd15b64c8cb2..e2c5ea2b35d7a3f665df6a222cb9535e599c1c98 100644 (file)
@@ -80,7 +80,7 @@ float Obituary_WeaponDeath(
 
 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype);
 
-void Ice_Think();
+void Ice_Think(entity this);
 
 void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint);
 
@@ -106,7 +106,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
 .float fire_hitsound;
 .entity fire_burner;
 
-void fireburner_think();
+void fireburner_think(entity this);
 
 float Fire_IsBurning(entity e);
 
@@ -115,5 +115,3 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt);
 void Fire_ApplyDamage(entity e);
 
 void Fire_ApplyEffect(entity e);
-
-void fireburner_think();
index 34719e2f49d1d89ee150b1f3c9fef7fbfdbc84b7..3be5e6667b1f5c2be1f67524d002b427a484259e 100644 (file)
@@ -90,7 +90,7 @@ void GrapplingHookReset(entity this)
                remove(this);
 }
 
-void GrapplingHookThink();
+void GrapplingHookThink(entity this);
 void GrapplingHook_Stop()
 {SELFPARAM();
        Send_Effect(EFFECT_HOOK_IMPACT, self.origin, '0 0 0', 1);
@@ -134,8 +134,8 @@ bool GrapplingHookSend(entity this, entity to, int sf)
 
 int autocvar_g_grappling_hook_tarzan;
 
-void GrapplingHookThink()
-{SELFPARAM();
+void GrapplingHookThink(entity this)
+{
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
        vector dir, org, end, v0, dv, v, myorg, vs;
        if(self.realowner.hook != self) // how did that happen?
@@ -301,8 +301,8 @@ void GrapplingHookThink()
        }
 }
 
-void GrapplingHookTouch ()
-{SELFPARAM();
+void GrapplingHookTouch (entity this)
+{
        if(other.movetype == MOVETYPE_FOLLOW)
                return;
        PROJECTILE_TOUCH;
index b8237fa6da196778bad5a2ee8ddd91439ea73b51..796af16b13e5efe2a1a0307d32a0dc34d1cf3102 100644 (file)
@@ -1,6 +1,6 @@
 #include "g_lights.qh"
 
-void train_next();
+void train_next(entity this);
 
 const float LOOP = 1;
 
@@ -34,9 +34,8 @@ flags:
 "NOSHADOW" will not cast shadows in realtime lighting mode
 "FOLLOW" will follow the entity which "targetname" matches "target"
 */
-void dynlight_think()
+void dynlight_think(entity this)
 {
-    SELFPARAM();
        if(!self.owner)
                remove(self);
 
index b46907433df87332ec95bc6b31180d6c119b5f06..1b785c2f284b6f59232519cbc2c0d87301a52447 100644 (file)
@@ -1,9 +1,9 @@
 #pragma once
 
-void SUB_NullThink();
+void SUB_NullThink(entity this);
 
-void()  SUB_CalcMoveDone;
-void() SUB_CalcAngleMoveDone;
+void SUB_CalcMoveDone(entity this);
+void SUB_CalcAngleMoveDone(entity this);
 
 spawnfunc(info_null);
 
@@ -26,7 +26,7 @@ Makes client invisible or removes non-client
 */
 void SUB_VanishOrRemove (entity ent);
 
-void SUB_SetFade_Think ();
+void SUB_SetFade_Think (entity this);
 
 /*
 ==================
@@ -45,20 +45,20 @@ calculate self.velocity and self.nextthink to reach dest from
 self.origin traveling at speed
 ===============
 */
-void SUB_CalcMoveDone ();
+void SUB_CalcMoveDone(entity this);
 
 .float platmovetype_turn;
-void SUB_CalcMove_controller_think ();
+void SUB_CalcMove_controller_think (entity this);
 
 void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector control, vector dest);
 
 void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest);
 
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func);
+void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
-void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func);
+void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
-void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func);
+void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
 /*
 =============
@@ -70,12 +70,12 @@ self.angles rotating
 The calling function should make sure self.think is valid
 ===============
 */
-void SUB_CalcAngleMoveDone ();
+void SUB_CalcAngleMoveDone (entity this);
 
 // FIXME: I fixed this function only for rotation around the main axes
-void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void() func);
+void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void(entity this) func);
 
-void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func);
+void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func);
 
 /*
 ==================
index f55b4f71926619c735db8927627c9215c3e1139b..9d67d334669faa4802778388bd797d63206479ab 100644 (file)
@@ -41,8 +41,8 @@ const float LATENCY_THINKRATE = 10;
 .float latency_cnt;
 .float latency_time;
 entity pingplreport;
-void PingPLReport_Think()
-{SELFPARAM();
+void PingPLReport_Think(entity this)
+{
        float delta;
        entity e;
 
@@ -104,8 +104,8 @@ void SetDefaultAlpha()
        }
 }
 
-void GotoFirstMap()
-{SELFPARAM();
+void GotoFirstMap(entity this)
+{
        float n;
        if(autocvar__sv_init)
        {
@@ -515,8 +515,8 @@ bool RandomSeed_Send(entity this, entity to, int sf)
        WriteShort(MSG_ENTITY, this.cnt);
        return true;
 }
-void RandomSeed_Think()
-{SELFPARAM();
+void RandomSeed_Think(entity this)
+{
        this.cnt = bound(0, floor(random() * 65536), 65535);
        this.nextthink = time + 5;
 
@@ -528,7 +528,7 @@ void RandomSeed_Spawn()
        setthink(randomseed, RandomSeed_Think);
        Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
 
-       WITHSELF(randomseed, getthink(randomseed)()); // sets random seed and nextthink
+       WITHSELF(randomseed, getthink(randomseed)(randomseed)); // sets random seed and nextthink
 }
 
 spawnfunc(__init_dedicated_server)
index ec845454a951714885dbf5768bc6e6a4703f02c3..5de4c56a7e796260d04e69b812ba8f8ffc2320e9 100644 (file)
@@ -196,8 +196,8 @@ LABEL(skip)
        }
 }
 
-void OnlineBanList_Think()
-{SELFPARAM();
+void OnlineBanList_Think(entity this)
+{
        float argc;
        string uri;
        float i, n;
index ca4d8cf0895e692d86658c58468cfc87b3ff05c5..bf389377f726e8fdf0b907d71883a7d7fd7b0dc0 100644 (file)
@@ -68,8 +68,8 @@ item_key
 /**
  * Key touch handler.
  */
-void item_key_touch()
-{SELFPARAM();
+void item_key_touch(entity this)
+{
        if (!IS_PLAYER(other))
                return;
 
index 5802a5b97e981cac2c008c76bd0f27259e7c335d..3a918c27307763e07b213a42fb84c8a06b942d98 100644 (file)
@@ -960,11 +960,11 @@ void EliminatedPlayers_Init(float(entity) isEliminated_func)
 
 
 
-void adaptor_think2use_hittype_splash() // for timed projectile detonation
-{SELFPARAM();
+void adaptor_think2use_hittype_splash(entity this) // for timed projectile detonation
+{
        if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
                this.projectiledeathtype |= HITTYPE_SPLASH;
-       WITHSELF(this, adaptor_think2use());
+       WITHSELF(this, adaptor_think2use(this));
 }
 
 // deferred dropping
index 2e947f29db24ca9bae03343c332df2c69c97a2a2..634d3fb647185594e04001b18c1b1790ecf17942 100644 (file)
@@ -116,8 +116,6 @@ void WarpZone_crosshair_trace(entity pl);
 
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
 
-void adaptor_think2use();
-
 #define IS_DEAD(s) ((s).deadflag != DEAD_NO)
 
 
index f22ba7bd9c8c8be7f589e46986b801d28602c3d6..47544dacde8a9a4365179e9fdf33306c2c4eea1c 100644 (file)
@@ -225,7 +225,7 @@ void assault_roundstart_use(entity this, entity actor, entity trigger)
                        it.team = NUM_TEAM_1;
 
                // Dubbles as teamchange
-               WITHSELF(it, turret_respawn());
+               WITHSELF(it, turret_respawn(it));
        ));
 }
 void assault_roundstart_use_this(entity this)
@@ -238,8 +238,8 @@ void assault_roundstart_use_self()
     assault_roundstart_use(this, NULL, NULL);
 }
 
-void assault_wall_think()
-{SELFPARAM();
+void assault_wall_think(entity this)
+{
        if(self.enemy.health < 0)
        {
                self.model = "";
@@ -257,7 +257,7 @@ void assault_wall_think()
 // trigger new round
 // reset objectives, toggle spawnpoints, reset triggers, ...
 void vehicles_clearreturn(entity veh);
-void vehicles_spawn();
+void vehicles_spawn(entity this);
 void assault_new_round()
 {SELFPARAM();
        //bprint("ASSAULT: new round\n");
@@ -267,7 +267,7 @@ void assault_new_round()
 
     FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
         vehicles_clearreturn(it);
-        WITHSELF(it, vehicles_spawn());
+        WITHSELF(it, vehicles_spawn(it));
     ));
 
        // up round counter
index 4f449a1923448fa662e18abf5075e7e266beb507..bb949a49de9869fe87609336f36825dd23cf1f5b 100644 (file)
@@ -286,8 +286,8 @@ bool ctf_CaptureShield_Customize()
        return true;
 }
 
-void ctf_CaptureShield_Touch()
-{SELFPARAM();
+void ctf_CaptureShield_Touch(entity this)
+{
        if(!other.ctf_captureshielded) { return; }
        if(CTF_SAMETEAM(self, other)) { return; }
 
@@ -851,8 +851,8 @@ void ctf_FlagDamage(entity this, entity inflictor, entity attacker, float damage
        }
 }
 
-void ctf_FlagThink()
-{SELFPARAM();
+void ctf_FlagThink(entity this)
+{
        // declarations
        entity tmp_entity;
 
index c44dfc3743783e2062d77eb2ab370fae1b240099..95e0bcd424ded55bc032f93b0706baf02eb4f882 100644 (file)
@@ -20,7 +20,7 @@ CLASS(Flag, Pickup)
     ATTRIB(Flag, m_maxs, vector, PL_MAX_CONST + '0 0 -13')
 ENDCLASS(Flag)
 Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
-void ctf_FlagTouch() { SELFPARAM(); ITEM_HANDLE(Pickup, CTF_FLAG, this, other); }
+void ctf_FlagTouch(entity this) { ITEM_HANDLE(Pickup, CTF_FLAG, this, other); }
 
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
 
index ecf3cb0c13d9585fa5e04f5d05750dc9663aafb9..1584933063e2386780479cc319f9252fcaed254c 100644 (file)
@@ -96,7 +96,7 @@ void cts_EventLog(string mode, entity actor) // use an alias for easy changing a
                GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
 }
 
-void KillIndicator_Think();
+void KillIndicator_Think(entity this);
 void CTS_ClientKill(entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
 {
     e.killindicator = spawn();
index 7bed67bc9679341c07cd464261efd76863f901a4..5514ed201b8c01eb1992f0b658725b87b90b4823 100644 (file)
@@ -207,8 +207,8 @@ void AnimateDomPoint()
                self.frame = 0;
 }
 
-void dompointthink()
-{SELFPARAM();
+void dompointthink(entity this)
+{
        float fragamt;
 
        self.nextthink = time + 0.1;
@@ -251,8 +251,8 @@ void dompointthink()
        }
 }
 
-void dompointtouch()
-{SELFPARAM();
+void dompointtouch(entity this)
+{
        entity head;
        if (!IS_PLAYER(other))
                return;
@@ -306,8 +306,6 @@ void dompointtouch()
        dompoint_captured();
 }
 
-void dom_controlpoint_setup(entity this);
-void dom_controlpoint_setup_self() { SELFPARAM(); dom_controlpoint_setup(this); }
 void dom_controlpoint_setup(entity this)
 {
        entity head;
@@ -540,7 +538,7 @@ spawnfunc(dom_controlpoint)
                remove(this);
                return;
        }
-       setthink(this, dom_controlpoint_setup_self);
+       setthink(this, dom_controlpoint_setup);
        this.nextthink = time + 0.1;
        this.reset = dom_controlpoint_setup;
 
@@ -652,12 +650,11 @@ void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float p
        //eprint(e);
 }
 
-void self_spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
 void dom_spawnpoint(vector org)
 {
        entity e = spawn();
        e.classname = "dom_controlpoint";
-       setthink(e, self_spawnfunc_dom_controlpoint);
+       setthink(e, spawnfunc_dom_controlpoint);
        e.nextthink = time;
        setorigin(e, org);
        spawnfunc_dom_controlpoint(e);
index 418e5638dcb64eaed4dbe5b74fd4689da973aa62..d3e40465c1376323c526c52193c83b8ecee32445 100644 (file)
@@ -141,7 +141,7 @@ void invasion_SpawnChosenMonster(float mon)
                        monster = spawnmonster("", mon, world, world, e.origin, false, false, 2);
                else return;
 
-               setthink(e, SUB_Remove_self);
+               setthink(e, SUB_Remove);
                e.nextthink = time + 0.1;
        }
        else
index 0d46dcaa472868f4a7a86590515ca5b106c4043e..22ae10f7c46810c17120a9ef73ba3b72ea61ca8e 100644 (file)
@@ -81,9 +81,8 @@ void ka_EventLog(string mode, entity actor) // use an alias for easy changing an
                GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
 }
 
-void ka_TouchEvent();
+void ka_TouchEvent(entity this);
 void ka_RespawnBall(entity this);
-void ka_RespawnBall_self() { SELFPARAM(); ka_RespawnBall(this); }
 void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
 {
        if(gameover) { return; }
@@ -102,7 +101,7 @@ void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
        self.angles = '0 0 0';
        self.effects = autocvar_g_keepawayball_effects;
        settouch(self, ka_TouchEvent);
-       setthink(self, ka_RespawnBall_self);
+       setthink(self, ka_RespawnBall);
        self.nextthink = time + autocvar_g_keepawayball_respawntime;
 
        Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
@@ -114,8 +113,8 @@ void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
        sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 }
 
-void ka_TimeScoring()
-{SELFPARAM();
+void ka_TimeScoring(entity this)
+{
        if(self.owner.ballcarried)
        { // add points for holding the ball after a certain amount of time
                if(autocvar_g_keepaway_score_timepoints)
@@ -126,8 +125,8 @@ void ka_TimeScoring()
        }
 }
 
-void ka_TouchEvent() // runs any time that the ball comes in contact with something
-{SELFPARAM();
+void ka_TouchEvent(entity this) // runs any time that the ball comes in contact with something
+{
        if(gameover) { return; }
        if(!self) { return; }
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
@@ -195,7 +194,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.movetype = MOVETYPE_BOUNCE;
        ball.wait = time + 1;
        settouch(ball, ka_TouchEvent);
-       setthink(ball, ka_RespawnBall_self);
+       setthink(ball, ka_RespawnBall);
        ball.nextthink = time + autocvar_g_keepawayball_respawntime;
        ball.takedamage = DAMAGE_YES;
        ball.effects &= ~EF_NODRAW;
@@ -232,7 +231,7 @@ void ka_Reset(entity this)
 
        if(time < game_starttime)
        {
-               setthink(this, ka_RespawnBall_self);
+               setthink(this, ka_RespawnBall);
                settouch(this, func_null);
                this.nextthink = game_starttime;
        }
index 6552d3c4a2386bccf3f4aa2997061e7ec77f317d..4d65abf9e0b7a98ae7793cea950dc123750fc5dc 100644 (file)
@@ -215,8 +215,8 @@ void kh_Controller_SetThink(float t, kh_Think_t func)  // runs occasionaly
                kh_controller.nextthink = time; // force
 }
 void kh_WaitForPlayers();
-void kh_Controller_Think()  // called a lot
-{SELFPARAM();
+void kh_Controller_Think(entity this)  // called a lot
+{
        if(intermission_running)
                return;
        if(self.cnt > 0)
@@ -505,8 +505,8 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
        kh_Key_AssignTo(key, player); // this also updates .kh_state
 }
 
-void kh_Key_Touch()  // runs many, many times when a key has been dropped and can be picked up
-{SELFPARAM();
+void kh_Key_Touch(entity this)  // runs many, many times when a key has been dropped and can be picked up
+{
        if(intermission_running)
                return;
 
@@ -726,8 +726,8 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
        kh_FinishRound();
 }
 
-void kh_Key_Think()  // runs all the time
-{SELFPARAM();
+void kh_Key_Think(entity this)  // runs all the time
+{
        if(intermission_running)
                return;
 
index f45fc84cce2affe1a968378c012301281265f2ad..98eb9cdcf301fcc1b64c63578d69fc2a51d9235b 100644 (file)
@@ -298,8 +298,8 @@ MUTATOR_HOOKFUNCTION(lms, FilterItem)
        return true;
 }
 
-void lms_extralife()
-{SELFPARAM();
+void lms_extralife(entity this)
+{
        StartItem(this, ITEM_ExtraLife);
 }
 
index fff4b606c65e2a718b84f26aa65674228fd74dea..15a845c5a104b9c874cdf443969cbff3ce870bad 100644 (file)
@@ -29,8 +29,8 @@ void path_dbg_think()
     self.nextthink = time + 1;
 }
 
-void __showpath2_think()
-{SELFPARAM();
+void __showpath2_think(entity this)
+{
     #ifdef TURRET_DEBUG
        mark_info(self.origin,1);
        #endif
@@ -82,7 +82,7 @@ void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 
     s           = spawn();
     s.alpha     = 0.25;
-    setthink(s, SUB_Remove_self);
+    setthink(s, SUB_Remove);
     s.nextthink = _lifetime;
     s.scale     = pathlib_gridsize / 512.001;
     s.solid     = SOLID_NOT;
@@ -107,7 +107,7 @@ void pathlib_showedge(vector where,float _lifetime,float rot)
 
     e           = spawn();
     e.alpha     = 0.25;
-    setthink(e, SUB_Remove_self);
+    setthink(e, SUB_Remove);
     e.nextthink = _lifetime;
     e.scale     = pathlib_gridsize / 512;
     e.solid     = SOLID_NOT;
index cb38136cb0058b1d4e67d97bb2f4c1f02733edb3..b3ae090fbe0fe64447e426d579dc0515d3edafcd 100644 (file)
@@ -11,7 +11,7 @@ void pathlib_deletepath(entity start)
     e = findchainentity(owner, start);
     while(e)
     {
-        setthink(e, SUB_Remove_self);
+        setthink(e, SUB_Remove);
         e.nextthink = time;
         e = e.chain;
     }
@@ -23,7 +23,7 @@ const float PATHLIB_NODEEXPIRE = 20;
 void dumpnode(entity n)
 {
     n.is_path_node = false;
-    setthink(n, SUB_Remove_self);
+    setthink(n, SUB_Remove);
     n.nextthink    = time;
 }
 
@@ -49,7 +49,7 @@ entity pathlib_mknode(vector where,entity parent)
 
     node = spawn();
 
-    setthink(node, SUB_Remove_self);
+    setthink(node, SUB_Remove);
     node.nextthink    = time + PATHLIB_NODEEXPIRE;
     node.is_path_node = true;
     node.owner        = openlist;
index 2188702f96d961a80c973ec76cf77ed2f5305c6a..52d0005a1efb583aa51887f2da9605918f7e5954 100644 (file)
@@ -73,8 +73,8 @@ vector pathlib_flynode(entity this, vector start, vector end, float doedge)
     return end;
 }
 
-void a_think()
-{SELFPARAM();
+void a_think(entity this)
+{
     te_lightning1(this,this.origin, this.pos1);
     if(this.cnt < time)
         remove(this);
index e96de83283e50cbd2e92628ffcf85898c54030a8..f86c270b04b3e32ad6ff14294190983f7e7ca699 100644 (file)
@@ -234,8 +234,8 @@ entity pathlib_waypointpath_step()
 
     return world;
 }
-void plas_think()
-{SELFPARAM();
+void plas_think(entity this)
+{
     pathlib_waypointpath_step();
     if(pathlib_foundgoal)
         return;
index 01f578a82345ffb72a94251fe059f00e2a646a68..f0728b720084d011d909ce684835f2fb1c5aacd8 100644 (file)
@@ -249,8 +249,8 @@ float Portal_WillHitPlane(vector eorg, vector emins, vector emaxs, vector evel,
 #endif
 }
 
-void Portal_Touch()
-{SELFPARAM();
+void Portal_Touch(entity this)
+{
        vector g;
 
 #ifdef PORTALS_ARE_NOT_SOLID
@@ -322,7 +322,7 @@ void Portal_Touch()
                                other.effects += EF_BLUE - EF_RED;
 }
 
-void Portal_Think();
+void Portal_Think(entity this);
 void Portal_MakeBrokenPortal(entity portal)
 {
        portal.skin = 2;
@@ -452,8 +452,8 @@ void Portal_Think_TryTeleportPlayer(entity this, entity e, vector g)
                Portal_TeleportPlayer(this, e);
 }
 
-void Portal_Think()
-{SELFPARAM();
+void Portal_Think(entity this)
+{
        entity o;
        vector g;
 
@@ -574,8 +574,8 @@ void Portal_ClearAll(entity own)
        Portal_ClearAll_PortalsOnly(own);
        W_Porto_Remove(own);
 }
-void Portal_RemoveLater_Think()
-{SELFPARAM();
+void Portal_RemoveLater_Think(entity this)
+{
        Portal_Remove(this, this.cnt);
 }
 void Portal_RemoveLater(entity portal, float kill)
index 67e9d73eecb6ba5e3e9b283634b4ee3ec75f31df..3d4bb782f3dfbb024559a246285fde9f26e18901 100644 (file)
@@ -698,8 +698,8 @@ void checkpoint_passed(entity this, entity player)
        }
 }
 
-void checkpoint_touch()
-{SELFPARAM();
+void checkpoint_touch(entity this)
+{
        EXACTTRIGGER_TOUCH;
        checkpoint_passed(this, other);
 }
@@ -1093,8 +1093,8 @@ void race_ImposePenaltyTime(entity pl, float penalty, string reason)
        }
 }
 
-void penalty_touch()
-{SELFPARAM();
+void penalty_touch(entity this)
+{
        EXACTTRIGGER_TOUCH;
        if(other.race_lastpenalty != this)
        {
index 8810ff02701585bfc536895408b91116b72b2ad5..ad0fcaae66278f5a93a47b76f76603874e6deda2 100644 (file)
@@ -3,10 +3,8 @@
 #include "command/vote.qh"
 #include "../common/util.qh"
 
-void round_handler_Think()
+void round_handler_Think(entity this)
 {
-       SELFPARAM();
-
        if (time < game_starttime)
        {
                round_handler_Reset(game_starttime);
@@ -76,9 +74,8 @@ void round_handler_Init(float the_delay, float the_count, float the_round_timeli
 
 // NOTE: this is only needed because if round_handler spawns at time 1
 // gamestarttime isn't initialized yet
-void round_handler_FirstThink()
+void round_handler_FirstThink(entity this)
 {
-       SELFPARAM();
        round_starttime = max(time, game_starttime) + this.count;
        setthink(this, round_handler_Think);
        this.nextthink = max(time, game_starttime);
index d725654b3ac2c781188ce93c5f7e448f7531a718..69c1360851f2c41e9d694a3790a4552e784847ba 100644 (file)
@@ -47,9 +47,8 @@ bool SpawnEvent_Send(entity this, entity to, int sf)
 }
 
 .vector spawnpoint_prevorigin;
-void spawnpoint_think()
+void spawnpoint_think(entity this)
 {
-    SELFPARAM();
        this.nextthink = time + 0.1;
        if(this.origin != this.spawnpoint_prevorigin)
        {
index 921da4f3a28f0b37ce52db585d9fbce10eae97f4..4caadee23834008b4ca124baeffe25baf7859296 100644 (file)
@@ -129,7 +129,7 @@ void target_give_init(entity this)
                else if (targ.classname == "item_health_mega")
                        this.health = 200;
                //remove(targ); // removing ents in init functions causes havoc, workaround:
-        setthink(targ, SUB_Remove_self);
+        setthink(targ, SUB_Remove);
         targ.nextthink = time;
        }
        this.spawnflags = 2;
index 272a91ff7350655619892fa1d9620e664510064e..954f82564fb9a5e17a8ee49924987c3c45e22a00 100644 (file)
@@ -73,7 +73,7 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype,
        return true; // if none of these return, then allow damage anyway.
 }
 
-void W_PrepareExplosionByDamage(entity this, entity attacker, void() explode)
+void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
 {
        this.takedamage = DAMAGE_NO;
        this.event_damage = func_null;
index 2ab8ea5acca6832f9eda13b257ff006cf0f8cbee..363941b3a71210d24917f897f37c92c52f254d5b 100644 (file)
@@ -5,4 +5,4 @@ void W_GiveWeapon (entity e, float wep);
 .float prevstrengthsoundattempt;
 void W_PlayStrengthSound(entity player);
 float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception);
-void W_PrepareExplosionByDamage(entity this, entity attacker, void() explode);
+void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode);
index f1977c8f0c0ddf3ddb958900d8a5dbc1cda2a5e9..fe59b5bfbbc3a5f45a494021ad41960df96ac41f 100644 (file)
@@ -12,8 +12,8 @@
 #include <common/weapons/all.qh>
 #include <common/state.qh>
 
-void thrown_wep_think()
-{SELFPARAM();
+void thrown_wep_think(entity this)
+{
        this.nextthink = time;
        if(this.oldorigin != this.origin)
        {
index b0482da9193bd34cb84b18e1d8a65dff74ef7db6..5a27025bc8bfcd146ed19a9a52eed1600ed66f75 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 .float savenextthink;
-void thrown_wep_think();
+void thrown_wep_think(entity this);
 
 // returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
 string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
index 0e7f399d01346bb1a2125a63d4bd5d613bb0cd42..97e008cc0ee487b21219d7bd23e35201769eb8e6 100644 (file)
@@ -62,9 +62,8 @@ vector CL_Weapon_GetShotOrg(int wpn)
 ..entity weaponentity_fld;
 .float m_alpha;
 
-void CL_Weaponentity_Think()
+void CL_Weaponentity_Think(entity this)
 {
-       SELFPARAM();
        this.nextthink = time;
        if (intermission_running) this.frame = this.anim_idle.x;
        .entity weaponentity = this.weaponentity_fld;
@@ -107,9 +106,8 @@ void CL_Weaponentity_Think()
        }
 }
 
-void CL_ExteriorWeaponentity_Think()
+void CL_ExteriorWeaponentity_Think(entity this)
 {
-       SELFPARAM();
        this.nextthink = time;
        if (this.owner.exteriorweaponentity != this)
        {