]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/aim.qc
also get rid of CHAN_WEAPON2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / aim.qc
index 9300ac721d889366a386bc8b0a06fb0656ad1443..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)
@@ -113,6 +114,12 @@ 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 && ka_ball.owner)
+                       return FALSE;
+
        if(teamplay)
        {
                if(e.team==0)