From b41f8d337c7b9d2863bf45f03f5919b6a522d669 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 Feb 2013 16:17:13 +1100 Subject: [PATCH] Fix monsters not attacking target entities --- qcsrc/server/mutators/gamemode_rts.qc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_rts.qc b/qcsrc/server/mutators/gamemode_rts.qc index 1774bba92..003534f8e 100644 --- a/qcsrc/server/mutators/gamemode_rts.qc +++ b/qcsrc/server/mutators/gamemode_rts.qc @@ -101,12 +101,15 @@ MUTATOR_HOOKFUNCTION(rts_PlayerThink) } if(self.BUTTON_ATCK2) { - entity e; + entity e = world; if(self.cursor_trace_ent) e = self.cursor_trace_ent; else e = findradius(self.cursor_trace_endpos, 50); - if(!IsDifferentTeam(e, self) || !e.takedamage) - e = world; + if not(IsDifferentTeam(e, self)) + e = world; // same team + + if not(e.takedamage) + e = world; // can't hurt this enemy if(e == world) { @@ -121,7 +124,11 @@ MUTATOR_HOOKFUNCTION(rts_PlayerThink) if not(head.selected) continue; if(e) + { + remove(head.goalentity); + head.goalentity = world; head.enemy = e; + } else if(wp) { head.goalentity = wp; -- 2.39.2