From b059166587b969488bf342c7e87d2baec8657dad Mon Sep 17 00:00:00 2001 From: Paul Scott Date: Sat, 4 Jun 2011 17:24:14 +1000 Subject: [PATCH] Bots will attack if no one has the ball yet. Once someone has collected the ball they will ignore all other players and focus on the ball carrier. --- qcsrc/server/bot/aim.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index b682044ec..5277b400b 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -1,4 +1,5 @@ +entity ka_ball; // traces multiple trajectories to find one that will impact the target // 'end' vector is the place it aims for, // returns TRUE only if it hit targ (don't target non-solid entities) @@ -113,8 +114,10 @@ float bot_shouldattack(entity e) if(e.freezetag_frozen) return FALSE; + // If neither player has ball then don't attack unless the ball is on the + // ground. if (g_keepaway) - if (!e.ballcarried && !self.ballcarried) + if (!e.ballcarried && !self.ballcarried && ka_ball.owner) return FALSE; if(teams_matter) -- 2.39.2