From 1225aa2d768a81493201ea96e892ac9409dcda8b Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 8 Feb 2013 11:37:55 +1100 Subject: [PATCH] Fix monsters not able to target turrets --- qcsrc/server/mutators/gamemode_rts.qc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qcsrc/server/mutators/gamemode_rts.qc b/qcsrc/server/mutators/gamemode_rts.qc index edef364c3..3ecab89c3 100644 --- a/qcsrc/server/mutators/gamemode_rts.qc +++ b/qcsrc/server/mutators/gamemode_rts.qc @@ -130,6 +130,19 @@ MUTATOR_HOOKFUNCTION(rts_PlayerThink) { entity e = self.cursor_trace_ent; + if not(e) + { + entity t; + for(t = world; (t = findflags(t, turrcaps_flags, TFL_TURRCAPS_ISTURRET)); ) + { + if(vlen(self.cursor_trace_endpos - t.origin) < 80) + { + e = t; + break; // don't bother checking any other turrets + } + } + } + if(e) if not(IsDifferentTeam(e, self) || e.takedamage) e = world; -- 2.39.2