From a50c4f0676289e8ceb3a3df8bc84ad8f93085e61 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 9 Jun 2016 21:44:22 +1000 Subject: [PATCH] Remove selfparam from triggers --- qcsrc/common/physics/movetypes/movetypes.qh | 2 +- qcsrc/common/triggers/func/breakable.qc | 8 ++-- qcsrc/common/triggers/func/button.qc | 14 +++--- qcsrc/common/triggers/func/door.qc | 52 ++++++++++----------- qcsrc/common/triggers/func/door_secret.qc | 8 ++-- qcsrc/common/triggers/func/ladder.qc | 7 ++- qcsrc/common/triggers/func/plat.qc | 8 ++-- qcsrc/common/triggers/func/train.qc | 16 +++---- qcsrc/common/triggers/platforms.qc | 21 +++++---- qcsrc/common/triggers/platforms.qh | 4 +- qcsrc/common/triggers/subs.qc | 22 ++++----- qcsrc/common/triggers/target/music.qc | 4 +- qcsrc/common/triggers/target/music.qh | 2 +- qcsrc/common/triggers/target/spawn.qc | 8 ++-- qcsrc/common/triggers/teleporters.qc | 5 +- qcsrc/common/triggers/trigger/jumppads.qc | 7 ++- qcsrc/common/triggers/trigger/secret.qc | 4 +- qcsrc/common/triggers/trigger/secret.qh | 2 +- qcsrc/server/cl_client.qc | 4 +- qcsrc/server/defs.qh | 4 +- qcsrc/server/g_subs.qh | 8 ++-- 21 files changed, 104 insertions(+), 106 deletions(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 931a0630d..a9d0c42e9 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -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; diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 246762659..d4abe5b81 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -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); } } diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index 5584f9ffa..ed972cd9f 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -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)); } } diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 92afdebec..580d63a14 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -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); diff --git a/qcsrc/common/triggers/func/door_secret.qc b/qcsrc/common/triggers/func/door_secret.qc index 12008e492..2156d5f83 100644 --- a/qcsrc/common/triggers/func/door_secret.qc +++ b/qcsrc/common/triggers/func/door_secret.qc @@ -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) diff --git a/qcsrc/common/triggers/func/ladder.qc b/qcsrc/common/triggers/func/ladder.qc index e0108cd8f..c446c3f3f 100644 --- a/qcsrc/common/triggers/func/ladder.qc +++ b/qcsrc/common/triggers/func/ladder.qc @@ -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"; } diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index 7e2ae74aa..ee942f4cb 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -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) diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 9c73e2b80..18b8d0834 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -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); diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 7b583f1d3..3819e9c7f 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -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! diff --git a/qcsrc/common/triggers/platforms.qh b/qcsrc/common/triggers/platforms.qh index f73da630f..acb90a7ef 100644 --- a/qcsrc/common/triggers/platforms.qh +++ b/qcsrc/common/triggers/platforms.qh @@ -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; diff --git a/qcsrc/common/triggers/subs.qc b/qcsrc/common/triggers/subs.qc index c2be7c72d..bb92dcca0 100644 --- a/qcsrc/common/triggers/subs.qc +++ b/qcsrc/common/triggers/subs.qc @@ -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)); } diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 32237200e..94c15c17a 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -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; diff --git a/qcsrc/common/triggers/target/music.qh b/qcsrc/common/triggers/target/music.qh index ff8b12fda..a9232107e 100644 --- a/qcsrc/common/triggers/target/music.qh +++ b/qcsrc/common/triggers/target/music.qh @@ -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(); diff --git a/qcsrc/common/triggers/target/spawn.qc b/qcsrc/common/triggers/target/spawn.qc index 5b6824283..a7c0c9351 100644 --- a/qcsrc/common/triggers/target/spawn.qc +++ b/qcsrc/common/triggers/target/spawn.qc @@ -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); } diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index c4322e943..492f7f353 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -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 diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index cbb2f0327..9e16c4ef0 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -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); } diff --git a/qcsrc/common/triggers/trigger/secret.qc b/qcsrc/common/triggers/trigger/secret.qc index a6f40be3e..5707a0ac3 100644 --- a/qcsrc/common/triggers/trigger/secret.qc +++ b/qcsrc/common/triggers/trigger/secret.qc @@ -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; } diff --git a/qcsrc/common/triggers/trigger/secret.qh b/qcsrc/common/triggers/trigger/secret.qh index dace6045f..c2a155ce7 100644 --- a/qcsrc/common/triggers/trigger/secret.qh +++ b/qcsrc/common/triggers/trigger/secret.qh @@ -19,6 +19,6 @@ float secrets_found; /** * update secrets status. */ -void secrets_setstatus(); +void secrets_setstatus(entity this); #endif #endif diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 4837c46d9..fe0c3a547 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 9f7026630..71583db6f 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/g_subs.qh b/qcsrc/server/g_subs.qh index 35d90ffee..591993346 100644 --- a/qcsrc/server/g_subs.qh +++ b/qcsrc/server/g_subs.qh @@ -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); -- 2.39.2