From 22d5da610f5cea65f0917a2d09d7f234cd575b0b Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 8 Mar 2013 05:51:41 +1100 Subject: [PATCH] Also use playerid for turret ownership --- qcsrc/server/mutators/gamemode_towerdefense.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index 1e1a8550a..87ea5c871 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -262,6 +262,7 @@ void spawnturret(entity spawnedby, entity own, string turet, vector orig) self.spawnflags = TSL_NO_RESPAWN; self.monster_attack = TRUE; self.realowner = own; + self.playerid = own.playerid; self.angles_y = spawnedby.v_angle_y; spawnedby.turret_cnt += 1; self.colormap = spawnedby.colormap; @@ -948,7 +949,7 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand) } if(cmd_name == "repairturret") { - if(trace_ent.realowner != self || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) + if((trace_ent.playerid != self.playerid || trace_ent.realowner != self) || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TD_AIM_REPAIR); return TRUE; @@ -973,7 +974,7 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand) } if(cmd_name == "buffturret") { - if(trace_ent.realowner != self || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) + if((trace_ent.playerid != self.playerid || trace_ent.realowner != self) || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TD_AIM_UPGRADE); return TRUE; @@ -998,7 +999,7 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand) } if(cmd_name == "turretremove") { - if((trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) && trace_ent.realowner == self) + if((trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) && (trace_ent.playerid == self.playerid || trace_ent.realowner == self)) { self.turret_cnt -= 1; Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TD_REMOVE); -- 2.39.2