From: Mircea Kitsune Date: Fri, 11 Feb 2011 23:17:49 +0000 (+0200) Subject: Only avoid a reload scheduled weapon if our current one has ammo. If we're out of... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bb09a895911dc09eb699b548ef3492be3dc594c4;p=xonotic%2Fxonotic-data.pk3dir.git Only avoid a reload scheduled weapon if our current one has ammo. If we're out of ammo, we must urgently switch to anything else --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 67e076f5c..b29885f6b 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -1007,6 +1007,7 @@ void havocbot_chooseweapon() if ( client_hasweapon(self, w, TRUE, FALSE) ) { if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + if not (weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) // we are out of ammo, so it's an emergency to switch to anything else continue; if ( self.weapon == w && combo) continue; @@ -1023,6 +1024,7 @@ void havocbot_chooseweapon() if ( client_hasweapon(self, w, TRUE, FALSE) ) { if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + if not (weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) // we are out of ammo, so it's an emergency to switch to anything else continue; if ( self.weapon == w && combo) continue; @@ -1038,6 +1040,7 @@ void havocbot_chooseweapon() if ( client_hasweapon(self, w, TRUE, FALSE) ) { if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + if not (weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) // we are out of ammo, so it's an emergency to switch to anything else continue; if ( self.weapon == w && combo) continue;