]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/aim.qc
Fix waypoint lookup on the waypoint hardwiring code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / aim.qc
index 9ef109e2b585e3c76053c7b183fbc49da22543ff..63e971b17da9c52cacc638e8ae6c3f006cff096f 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)
@@ -104,7 +105,7 @@ float bot_shouldattack(entity e)
        {
                if (e == self)
                        return FALSE;
-               if (teams_matter)
+               if (teamplay)
                if (e.team != 0)
                        return FALSE;
        }
@@ -113,7 +114,13 @@ float bot_shouldattack(entity e)
                if(e.freezetag_frozen)
                        return FALSE;
 
-       if(teams_matter)
+       // If neither player has ball then don't attack unless the ball is on the
+       // ground.
+       if (g_keepaway)
+               if (!e.ballcarried && !self.ballcarried && ka_ball.owner)
+                       return FALSE;
+
+       if(teamplay)
        {
                if(e.team==0)
                        return FALSE;