From 6d5fae3d4b0de76768abad58475ed7d72acff658 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 3 Jun 2016 18:53:16 +1000 Subject: [PATCH] Remove a now useless WITHSELF --- qcsrc/common/weapons/weapon/porto.qc | 30 ++++++++++++++-------------- qcsrc/server/race.qc | 7 +++---- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index c029c220d..ac9f759fc 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -68,37 +68,37 @@ void W_Porto_Success(entity this) string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo); void W_Porto_Fail(entity this, float failhard) { - if(self.realowner == world) + if(this.realowner == world) { objerror("Cannot fail successfully: no owner\n"); return; } // no portals here! - if(self.cnt < 0) + if(this.cnt < 0) { - Portal_ClearWithID(self.realowner, self.portal_id); + Portal_ClearWithID(this.realowner, this.portal_id); } - self.realowner.porto_current = world; + this.realowner.porto_current = world; - if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && !IS_DEAD(self.realowner) && !(self.realowner.weapons & WEPSET(PORTO))) + if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(this.realowner.weapons & WEPSET(PORTO))) { - setsize(self, '-16 -16 0', '16 16 32'); - setorigin(self, self.origin + trace_plane_normal); - if(move_out_of_solid(self)) + setsize(this, '-16 -16 0', '16 16 32'); + setorigin(this, this.origin + trace_plane_normal); + if(move_out_of_solid(this)) { - self.flags = FL_ITEM; - self.velocity = trigger_push_calculatevelocity(self.origin, self.realowner, 128); - tracetoss(self, self); - if(vdist(trace_endpos - self.realowner.origin, <, 128)) + this.flags = FL_ITEM; + this.velocity = trigger_push_calculatevelocity(this.origin, this.realowner, 128); + tracetoss(this, this); + if(vdist(trace_endpos - this.realowner.origin, <, 128)) { - W_ThrowNewWeapon(self.realowner, WEP_PORTO.m_id, 0, self.origin, self.velocity); - Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_FAILED); + W_ThrowNewWeapon(this.realowner, WEP_PORTO.m_id, 0, this.origin, this.velocity); + Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_FAILED); } } } - remove(self); + remove(this); } void W_Porto_Remove(entity p) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 34a3d8a2a..6fc5cf712 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -570,7 +570,7 @@ void checkpoint_passed(entity this, entity player) { // do not allow portalling through checkpoints trace_plane_normal = normalize(-1 * player.velocity); - WITHSELF(player, W_Porto_Fail(player, 0)); + W_Porto_Fail(player, 0); return; } @@ -581,7 +581,7 @@ void checkpoint_passed(entity this, entity player) { oldmsg = this.message; this.message = ""; - SUB_UseTargets(this, player, player); // TODO: should we be using other for the trigger here? + SUB_UseTargets(this, player, player); this.message = oldmsg; } @@ -709,8 +709,7 @@ void checkpoint_use(entity this, entity actor, entity trigger) if(trigger.classname == "info_player_deathmatch") // a spawn, a spawn return; - other = actor; - checkpoint_passed(this, other); + checkpoint_passed(this, actor); } bool race_waypointsprite_visible_for_player(entity this, entity player, entity view) -- 2.39.2