]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove selfparam from triggers
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 9 Jun 2016 11:44:22 +0000 (21:44 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 9 Jun 2016 11:44:44 +0000 (21:44 +1000)
21 files changed:
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/ladder.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/platforms.qh
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/music.qh
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/secret.qc
qcsrc/common/triggers/trigger/secret.qh
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/g_subs.qh

index 931a0630dbac126485cff3c1372c3fa8959aeb1a..a9d0c42e9b2f0e9d23d8a73be460da17d5d2d39e 100644 (file)
@@ -8,7 +8,7 @@
 .float move_ltime;
 .void(entity this) move_think;
 .float move_nextthink;
-.void()move_blocked;
+.void() move_blocked;
 
 .float move_movetype;
 .float move_time;
index 246762659aafbfcc7a9b3e1e23614432344af4da..d4abe5b8168fa92a62c3647de13e896893ad920d 100644 (file)
@@ -164,12 +164,12 @@ void func_breakable_behave_restore(entity this)
                _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
 }
 
-void func_breakable_init_for_player(entity player)
-{SELFPARAM();
-       if (self.noise1 && self.state == 0 && clienttype(player) == CLIENTTYPE_REAL)
+void func_breakable_init_for_player(entity this, entity player)
+{
+       if (this.noise1 && this.state == 0 && clienttype(player) == CLIENTTYPE_REAL)
        {
                msg_entity = player;
-               soundto (MSG_ONE, self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+               soundto (MSG_ONE, this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
        }
 }
 
index 5584f9ffa167bbb476fbd16ce6804e08ba3c836f..ed972cd9f97b1c78b86e2c9414af318c351f1181 100644 (file)
@@ -21,7 +21,7 @@ void button_done(entity this)
 void button_return(entity this)
 {
        self.state = STATE_DOWN;
-       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, button_done);
+       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, button_done);
        self.frame = 0;                 // use normal textures
        if (self.health)
                self.takedamage = DAMAGE_YES;   // can be shot again
@@ -34,8 +34,8 @@ void button_blocked()
 }
 
 
-void button_fire()
-{SELFPARAM();
+void button_fire(entity this)
+{
        self.health = self.max_health;
        self.takedamage = DAMAGE_NO;    // will be reset upon return
 
@@ -46,7 +46,7 @@ void button_fire()
                _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
        self.state = STATE_UP;
-       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, button_wait);
+       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, button_wait);
 }
 
 void button_reset(entity this)
@@ -65,7 +65,7 @@ void button_use(entity this, entity actor, entity trigger)
                return;
 
        this.enemy = actor;
-       WITHSELF(this, button_fire());
+       WITHSELF(this, button_fire(this));
 }
 
 void button_touch(entity this)
@@ -79,7 +79,7 @@ void button_touch(entity this)
        self.enemy = other;
        if (other.owner)
                self.enemy = other.owner;
-       button_fire ();
+       button_fire (self);
 }
 
 void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -91,7 +91,7 @@ void button_damage(entity this, entity inflictor, entity attacker, float damage,
        if (this.health <= 0)
        {
                this.enemy = damage_attacker;
-               WITHSELF(this, button_fire());
+               WITHSELF(this, button_fire(this));
        }
 }
 
index 92afdebecaf4c7c2749149b7704bd1bd88002c2f..580d63a145a6ee20ae5f94388d818fd5ca1cf389 100644 (file)
@@ -21,9 +21,9 @@ THINK FUNCTIONS
 */
 
 void door_go_down(entity this);
-void() door_go_up;
+void door_go_up(entity this);
 void door_rotating_go_down(entity this);
-void() door_rotating_go_up;
+void door_rotating_go_up(entity this);
 
 void door_blocked()
 {SELFPARAM();
@@ -58,10 +58,10 @@ void door_blocked()
                                if (self.state == STATE_DOWN)
                        if (self.classname == "door")
                        {
-                               door_go_up ();
+                               door_go_up (self);
                        } else
                        {
-                               door_rotating_go_up ();
+                               door_rotating_go_up (self);
                        }
                                else
                        if (self.classname == "door")
@@ -119,11 +119,11 @@ void door_go_down(entity this)
        }
 
        self.state = STATE_DOWN;
-       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
+       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
 }
 
-void door_go_up()
-{SELFPARAM();
+void door_go_up(entity this)
+{
        if (self.state == STATE_UP)
                return;         // already going up
 
@@ -136,7 +136,7 @@ void door_go_up()
        if (self.noise2 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
-       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
+       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
 
        string oldmessage;
        oldmessage = self.message;
@@ -232,7 +232,7 @@ void door_fire(entity this, entity actor, entity trigger)
        entity e = this;
        do {
                if (e.classname == "door") {
-                       WITHSELF(e, door_go_up());
+                       WITHSELF(e, door_go_up(e));
                } else {
                        // if the BIDIR spawnflag (==2) is set and the trigger has set trigger_reverse, reverse the opening direction
                        if ((e.spawnflags & 2) && other.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
@@ -243,7 +243,7 @@ void door_fire(entity this, entity actor, entity trigger)
                        if (!((e.spawnflags & 2) &&  (e.spawnflags & 8) && e.state == STATE_DOWN
                                && (((e.lip == 666) && (other.trigger_reverse == 0)) || ((e.lip != 666) && (other.trigger_reverse != 0)))))
                        {
-                               WITHSELF(e, door_rotating_go_up());
+                               WITHSELF(e, door_rotating_go_up(e));
                        }
                }
                e = e.enemy;
@@ -308,8 +308,8 @@ void door_touch(entity this)
 #endif
 }
 
-void door_generic_plat_blocked()
-{SELFPARAM();
+void door_generic_plat_blocked(entity this)
+{
 
        if((self.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
 #ifdef SVQC
@@ -330,7 +330,7 @@ void door_generic_plat_blocked()
                        if (self.wait >= 0)
                        {
                                if (self.state == STATE_DOWN)
-                                       door_rotating_go_up ();
+                                       door_rotating_go_up (self);
                                else
                                        door_rotating_go_down (self);
                        }
@@ -380,11 +380,11 @@ void door_rotating_go_down(entity this)
        }
 
        self.state = STATE_DOWN;
-       SUB_CalcAngleMove (self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
+       SUB_CalcAngleMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
 }
 
-void door_rotating_go_up()
-{SELFPARAM();
+void door_rotating_go_up(entity this)
+{
        if (self.state == STATE_UP)
                return;         // already going up
 
@@ -396,7 +396,7 @@ void door_rotating_go_up()
        if (self.noise2 != "")
                _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
-       SUB_CalcAngleMove (self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
+       SUB_CalcAngleMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
 
        string oldmessage;
        oldmessage = self.message;
@@ -436,8 +436,8 @@ void door_trigger_touch(entity this)
        door_use(this.owner, other, NULL);
 }
 
-void door_spawnfield(vector fmins, vector fmaxs)
-{SELFPARAM();
+void door_spawnfield(entity this, vector fmins, vector fmaxs)
+{
        entity  trigger;
        vector  t1 = fmins, t2 = fmaxs;
 
@@ -462,8 +462,8 @@ LinkDoors
 */
 
 entity LinkDoors_nextent(entity cur, entity near, entity pass)
-{SELFPARAM();
-       while((cur = find(cur, classname, self.classname)) && ((cur.spawnflags & 4) || cur.enemy))
+{
+       while((cur = find(cur, classname, pass.classname)) && ((cur.spawnflags & 4) || cur.enemy))
        {
        }
        return cur;
@@ -507,12 +507,12 @@ void LinkDoors(entity this)
                if (self.items)
                        return;
 
-               door_spawnfield(self.absmin, self.absmax);
+               door_spawnfield(self, self.absmin, self.absmax);
 
                return;         // don't want to link this door
        }
 
-       FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, world);
+       FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, self);
 
        // set owner, and make a loop of the chain
        LOG_TRACE("LinkDoors: linking doors:");
@@ -575,7 +575,7 @@ void LinkDoors(entity this)
        if (self.items)
                return;
 
-       door_spawnfield(cmins, cmaxs);
+       door_spawnfield(self, cmins, cmaxs);
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_DOOR)
@@ -610,8 +610,8 @@ FIXME: only one sound set available at the time being
 
 */
 
-float door_send(entity to, float sf)
-{SELFPARAM();
+float door_send(entity this, entity to, float sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_DOOR);
        WriteByte(MSG_ENTITY, sf);
 
index 12008e492d443896506773352d798e0ddbdf569c..2156d5f833cf3abb45699715a97bf2c399563372 100644 (file)
@@ -58,7 +58,7 @@ void fd_secret_use(entity this, entity actor, entity trigger)
                this.dest1 = this.origin + v_right * (this.t_width * temp);
 
        this.dest2 = this.dest1 + v_forward * this.t_length;
-       WITHSELF(this, SUB_CalcMove(this.dest1, TSPEED_LINEAR, this.speed, fd_secret_move1));
+       WITHSELF(this, SUB_CalcMove(this, this.dest1, TSPEED_LINEAR, this.speed, fd_secret_move1));
        if (this.noise2 != "")
                _sound(this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
 }
@@ -82,7 +82,7 @@ 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);
+       SUB_CalcMove(self, self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3);
 }
 
 // Wait here until time to go back...
@@ -102,7 +102,7 @@ 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);
+       SUB_CalcMove(self, self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5);
 }
 
 // Wait 1 second...
@@ -118,7 +118,7 @@ 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);
+       SUB_CalcMove(self, self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done);
 }
 
 void fd_secret_done(entity this)
index e0108cd8f0f030e0eaaa6124c20f373fa15a349f..c446c3f3fc1f8755548f8251bfba0ec3ca39cd3d 100644 (file)
@@ -19,8 +19,8 @@ void func_ladder_touch(entity this)
 }
 
 #ifdef SVQC
-bool func_ladder_send(entity to, int sf)
-{SELFPARAM();
+bool func_ladder_send(entity this, entity to, int sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_LADDER);
 
        WriteString(MSG_ENTITY, self.classname);
@@ -34,8 +34,7 @@ bool func_ladder_send(entity to, int sf)
 
 void func_ladder_link(entity this)
 {
-       this.SendEntity = func_ladder_send;
-       this.SendFlags = 0xFFFFFF;
+       trigger_link(this, func_ladder_send);
        //this.model = "null";
 }
 
index 7e2ae74aabfd5080e936a2f20fc615c8989d624d..ee942f4cb57c7fc1d5b5d8eb2123f7c417dd5cba 100644 (file)
@@ -6,11 +6,11 @@ void plat_link();
 void plat_delayedinit(entity this)
 {
        plat_link();
-       plat_spawn_inside_trigger(); // the "start moving" trigger
+       plat_spawn_inside_trigger(this); // the "start moving" trigger
 }
 
-float plat_send(entity to, float sf)
-{SELFPARAM();
+float plat_send(entity this, entity to, float sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_PLAT);
        WriteByte(MSG_ENTITY, sf);
 
@@ -181,7 +181,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
                this.move_angles = this.angles;
                this.move_time = time;
 
-               plat_spawn_inside_trigger();
+               plat_spawn_inside_trigger(this);
        }
 
        if(sf & SF_TRIGGER_RESET)
index 9c73e2b80b561d77235a122c6bd52dd8cdcd9752..18b8d083416541da0cf310aedd7b8aca1085e329 100644 (file)
@@ -27,9 +27,9 @@ void train_wait(entity this)
                ang_x = -ang_x; // flip up / down orientation
 
                if(self.wait > 0) // slow turning
-                       SUB_CalcAngleMove(ang, TSPEED_TIME, self.SUB_LTIME - time + self.wait, train_wait);
+                       SUB_CalcAngleMove(self, ang, TSPEED_TIME, self.SUB_LTIME - time + self.wait, train_wait);
                else // instant turning
-                       SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
+                       SUB_CalcAngleMove(self, ang, TSPEED_TIME, 0.0000001, train_wait);
                self.train_wait_turning = true;
                return;
        }
@@ -98,16 +98,16 @@ void train_next(entity this)
        if (targ.speed)
        {
                if (cp)
-                       SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+                       SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
                else
-                       SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+                       SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
        }
        else
        {
                if (cp)
-                       SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+                       SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
                else
-                       SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+                       SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
        }
 
        if(self.noise != "")
@@ -117,8 +117,8 @@ void train_next(entity this)
 REGISTER_NET_LINKED(ENT_CLIENT_TRAIN)
 
 #ifdef SVQC
-float train_send(entity to, float sf)
-{SELFPARAM();
+float train_send(entity this, entity to, float sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TRAIN);
        WriteByte(MSG_ENTITY, sf);
 
index 7b583f1d3d370545b900505b40167cadb966c2e3..3819e9c7fc97d7549fb1cd2d0c9883588ac433be 100644 (file)
@@ -17,8 +17,8 @@ void generic_plat_blocked()
 #endif
 }
 
-void plat_spawn_inside_trigger()
-{SELFPARAM();
+void plat_spawn_inside_trigger(entity this)
+{
        entity trigger;
        vector tmin, tmax;
 
@@ -77,14 +77,14 @@ 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);
+       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
 }
 
-void plat_go_up()
-{SELFPARAM();
+void plat_go_up(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 4;
-       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
+       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
 }
 
 void plat_center_touch(entity this)
@@ -102,9 +102,10 @@ void plat_center_touch(entity this)
                return;
 #endif
 
-       if (self.enemy.state == 2)
-               WITHSELF(self.enemy, plat_go_up());
-       else if (self.enemy.state == 1)
+       if (self.enemy.state == 2) {
+               entity e = self.enemy;
+               WITHSELF(e, plat_go_up(e));
+       } else if (self.enemy.state == 1)
                self.enemy.SUB_NEXTTHINK = self.enemy.SUB_LTIME + 1;
 }
 
@@ -163,7 +164,7 @@ void plat_crush()
                if (self.state == 4)
                        plat_go_down (self);
                else if (self.state == 3)
-                       plat_go_up ();
+                       plat_go_up (self);
        // when in other states, then the plat_crush event came delayed after
        // plat state already had changed
        // this isn't a bug per se!
index f73da630fd0cd174ec27c04b2a7825931ff76e1d..acb90a7efe71b78dae8d39bb1d2977dbd090fe2b 100644 (file)
@@ -6,9 +6,9 @@
 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_up(entity this);
 void plat_go_down(entity this);
-void() plat_crush;
+void plat_crush();
 const float PLAT_LOW_TRIGGER = 1;
 
 .float dmg;
index c2be7c72d925ecd12176b44d56ab3423354ae5c2..bb92dcca001b240b7c9a1f6693a14e6d43cb1dea 100644 (file)
@@ -11,8 +11,8 @@ Applies some friction to self
 ==================
 */
 .float friction;
-void SUB_Friction ()
-{SELFPARAM();
+void SUB_Friction (entity this)
+{
        self.SUB_NEXTTHINK = time;
        if(self.SUB_FLAGS & FL_ONGROUND)
                self.SUB_VELOCITY = self.SUB_VELOCITY * (1 - frametime * self.friction);
@@ -183,8 +183,8 @@ float TSPEED_START = 1;
 float TSPEED_END = 2;
 // TODO average too?
 
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
-{SELFPARAM();
+void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
+{
        float   traveltime;
        entity controller;
 
@@ -239,8 +239,8 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float
        WITHSELF(controller, getthink(controller)(controller));
 }
 
-void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void(entity this) func)
-{SELFPARAM();
+void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
+{
        vector  delta;
        float   traveltime;
 
@@ -285,12 +285,12 @@ void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void(entity thi
        }
 
        // now just run like a bezier curve...
-       SUB_CalcMove_Bezier((self.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
+       SUB_CalcMove_Bezier(self, (self.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
 }
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
 {
-       WITHSELF(ent, SUB_CalcMove(tdest, tspeedtype, tspeed, func));
+       WITHSELF(ent, SUB_CalcMove(ent, tdest, tspeedtype, tspeed, func));
 }
 
 /*
@@ -314,8 +314,8 @@ 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(entity this) func)
-{SELFPARAM();
+void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
+{
        vector  delta;
        float   traveltime;
 
@@ -358,5 +358,5 @@ void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void(e
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
 {
-       WITHSELF(ent, SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func));
+       WITHSELF(ent, SUB_CalcAngleMove (ent, destangle, tspeedtype, tspeed, func));
 }
index 32237200ee9bd93abda850564cb8bf9054800535..94c15c17a416b74eacf09f4a0380407800f790dd 100644 (file)
@@ -261,8 +261,8 @@ void Ent_TriggerMusic_Think(entity this)
        self.nextthink = time;
 }
 
-void Ent_TriggerMusic_Remove()
-{SELFPARAM();
+void Ent_TriggerMusic_Remove(entity this)
+{
        if(self.noise)
                strunzone(self.noise);
        self.noise = string_null;
index ff8b12fda49aa744a7b649e61360b0faf8ac3a04..a9232107ebbbed9407716c1e112acfab553a35b8 100644 (file)
@@ -20,7 +20,7 @@ void Net_TargetMusic();
 
 void Ent_TriggerMusic_Think(entity this);
 
-void Ent_TriggerMusic_Remove();
+void Ent_TriggerMusic_Remove(entity this);
 
 #elif defined(SVQC)
 void target_music_kill();
index 5b6824283cf4a1b28f6fd0ee43e68bf03a86c451..a7c0c93513a32bbb736c2040e03cf2910ba749be 100644 (file)
@@ -21,13 +21,13 @@ float target_spawn_spawnfunc_field;
 .float target_spawn_id;
 float target_spawn_count;
 
-void target_spawn_helper_setmodel()
-{SELFPARAM();
+void target_spawn_helper_setmodel(entity this)
+{
        _setmodel(self, self.model);
 }
 
-void target_spawn_helper_setsize()
-{SELFPARAM();
+void target_spawn_helper_setsize(entity this)
+{
        setsize(self, self.mins, self.maxs);
 }
 
index c4322e94382ed8de8b2cf20418c0935efac2e612..492f7f353716b77c61be26bb56be4a783ee688f8 100644 (file)
@@ -80,10 +80,9 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        makevectors (to_angles);
 
 #ifdef SVQC
-    SELFPARAM();
        if(player.teleportable == TELEPORT_NORMAL) // don't play sounds or show particles for anything that isn't a player, maybe change later to block only observers
        {
-               if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
+               if(teleporter.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
                {
                        if(tflags & TELEPORT_FLAG_SOUND)
                        {
@@ -104,7 +103,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                                Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1);
                                Send_Effect(EFFECT_TELEPORT, to + v_forward * 32, '0 0 0', 1);
                        }
-                       self.pushltime = time + 0.2;
+                       teleporter.pushltime = time + 0.2;
                }
        }
 #endif
index cbb2f03279d859bb79b84efd52803ebd771412f3..9e16c4ef06e128312859f57a16a3076cd10a9158 100644 (file)
@@ -270,7 +270,7 @@ void trigger_push_touch(entity this)
 }
 
 #ifdef SVQC
-void trigger_push_link();
+void trigger_push_link(entity this);
 void trigger_push_updatelink(entity this);
 #endif
 void trigger_push_findtarget(entity this)
@@ -331,7 +331,7 @@ void trigger_push_findtarget(entity this)
                remove(e);
        }
 
-       trigger_push_link();
+       trigger_push_link(this);
        defer(this, 0.1, trigger_push_updatelink);
 #endif
 }
@@ -356,9 +356,8 @@ void trigger_push_updatelink(entity this)
        this.SendFlags |= 1;
 }
 
-void trigger_push_link()
+void trigger_push_link(entity this)
 {
-    SELFPARAM();
        trigger_link(this, trigger_push_send);
 }
 
index a6f40be3ea5521a909f7d0df6c649e995e0da39c..5707a0ac3a10a12301e9aae49302c506f0a603b5 100644 (file)
@@ -8,8 +8,8 @@
 
 #ifdef SVQC
 
-void secrets_setstatus()
-{SELFPARAM();
+void secrets_setstatus(entity this)
+{
        this.stat_secrets_total = secrets_total;
        this.stat_secrets_found = secrets_found;
 }
index dace6045fb0c6a5dd40234adbabafd870cc32b52..c2a155ce72e0114e790e092d56dceacca0f25c74 100644 (file)
@@ -19,6 +19,6 @@ float secrets_found;
 /**
  * update secrets status.
  */
-void secrets_setstatus();
+void secrets_setstatus(entity this);
 #endif
 #endif
index 4837c46d9c70c0e3baf5c2c6615851daaa39d679..fe0c3a547fa776d04e5d13a42fd9ee11a2c69d38 100644 (file)
@@ -1162,7 +1162,7 @@ void ClientConnect()
                sv_notice_join(this);
 
        FOREACH_ENTITY_FLOAT(init_for_player_needed, true, {
-               WITHSELF(it, it.init_for_player(it));
+               it.init_for_player(it, this);
        });
 
        MUTATOR_CALLHOOK(ClientConnect, this);
@@ -2321,7 +2321,7 @@ void PlayerPreThink ()
                if (frametime) player_anim();
 
                // secret status
-               secrets_setstatus();
+               secrets_setstatus(this);
 
                // monsters status
                monsters_setstatus(this);
index 9f70266302307cd8d90145dc745f6bd98cda0bfa..71583db6f21c3cf34c0f11934258025be81b6ce1 100644 (file)
@@ -440,5 +440,5 @@ const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
 
 .string cvar_cl_physics;
 
-.float init_for_player_needed;
-.void(entity) init_for_player;
+.bool init_for_player_needed;
+.void(entity this, entity player) init_for_player;
index 35d90ffeedbc8aca75b148be10fd7b073ccae8c8..59199334638918308487ea18189a80c20823d845 100644 (file)
@@ -15,7 +15,7 @@ Applies some friction to self
 ==================
 */
 .float friction;
-void SUB_Friction ();
+void SUB_Friction (entity this);
 
 /*
 ==================
@@ -54,9 +54,9 @@ void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector co
 
 void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest);
 
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
+void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
-void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void(entity this) func);
+void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
 
@@ -73,7 +73,7 @@ The calling function should make sure self.think is valid
 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(entity this) func);
+void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float tspeed, void(entity this) func);
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func);