From 3e00d595b0a6a370e88059f344a86923eae89582 Mon Sep 17 00:00:00 2001 From: kadaverjack Date: Thu, 5 Jan 2006 15:53:26 +0000 Subject: [PATCH] prevent urrebots from attacking teammates git-svn-id: svn://svn.icculus.org/nexuiz/trunk@769 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/nexuiz.modinfo | 2 +- data/qcsrc/gamec/urrebot_ai_main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/nexuiz.modinfo b/data/nexuiz.modinfo index 637757d8e..ee0b26656 100644 --- a/data/nexuiz.modinfo +++ b/data/nexuiz.modinfo @@ -1,2 +1,2 @@ 'progs.dat' -'Nexuiz DM' \ No newline at end of file +'Nexuiz' diff --git a/data/qcsrc/gamec/urrebot_ai_main.c b/data/qcsrc/gamec/urrebot_ai_main.c index f2ba4aad6..64a0970f6 100644 --- a/data/qcsrc/gamec/urrebot_ai_main.c +++ b/data/qcsrc/gamec/urrebot_ai_main.c @@ -193,6 +193,7 @@ void() UrreBotEvalTargets = while (e) { if (!(e.flags & FL_NOTARGET) || e.killcount != -666) // -666 is spec/obs + if (!(cvar("teamplay") && self.team == e.team)) // don't target teammates if (e.flags & FL_CLIENT) if (e != self) if (!e.deadflag) @@ -649,6 +650,9 @@ void() UrreBotThink = self.button2 = 0; self.impulse = 0; + if (cvar("teamplay") && self.team == self.enemy.team) // don't return fire if hit by a teammate + self.enemy = world; + if (self.deadflag) { ClearRoute(); -- 2.39.2