]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bots will attack if no one has the ball yet. Once someone has collected
authorPaul Scott <poogascott@gmail.com>
Sat, 4 Jun 2011 07:24:14 +0000 (17:24 +1000)
committerPaul Scott <poogascott@gmail.com>
Sat, 4 Jun 2011 07:24:14 +0000 (17:24 +1000)
the ball they will ignore all other players and focus on the ball
carrier.

qcsrc/server/bot/aim.qc

index b682044ec2b36c751b6eb96e433a0ddf9cd4089c..5277b400b92dc5dcca610f45f6b61d3ff966bb41 100644 (file)
@@ -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)