]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Ok, let's do a few changes to the bot AI too. Bots should not switch weapons while...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 21:35:43 +0000 (23:35 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 21:35:43 +0000 (23:35 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index fc56cee645fee30886fc17db54db8a09ec751b50..0c5b82b7a9d14a7dbf2badd8022098f70e790853 100644 (file)
@@ -941,6 +941,11 @@ void havocbot_chooseweapon()
                return;
        }
 
+       // Do not change weapon while reloading. If we do, the bot risks switching betwen empty weapons
+       // before getting to reload them, shooting none of them at all, giving lower overall performance
+       if(self.weapon && self.clip_load < 1)
+               return;
+
        // Do not change weapon during the next second after a combo
        i = time - self.lastcombotime;
        if(i < 1)