projects
/
xonotic
/
xonotic-data.pk3dir.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd1795f
)
Fix monsters not able to target turrets
author
Mario <mario.mario@y7mail.com>
Fri, 8 Feb 2013 00:37:55 +0000
(11:37 +1100)
committer
Mario <mario.mario@y7mail.com>
Fri, 8 Feb 2013 00:37:55 +0000
(11:37 +1100)
qcsrc/server/mutators/gamemode_rts.qc
patch
|
blob
|
history
diff --git
a/qcsrc/server/mutators/gamemode_rts.qc
b/qcsrc/server/mutators/gamemode_rts.qc
index edef364c3a3a58618b64e824427766bb3cc40161..3ecab89c34a30f6f66ec59d7226f5118a17fe7c7 100644
(file)
--- 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;