From: Mircea Kitsune Date: Fri, 11 Feb 2011 21:35:43 +0000 (+0200) Subject: Ok, let's do a few changes to the bot AI too. Bots should not switch weapons while... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e6795dabb4058243920e10607f1b49fd81425b1;p=xonotic%2Fxonotic-data.pk3dir.git Ok, let's do a few changes to the bot AI too. Bots should not switch weapons while reloading. Since not being very intelligent, they will end up with lots of unloaded weapons they'll keep switching between, not getting to shoot many of them at all. --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index fc56cee64..0c5b82b7a 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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)