From bb09a895911dc09eb699b548ef3492be3dc594c4 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 12 Feb 2011 01:17:49 +0200 Subject: [PATCH] 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 --- qcsrc/server/bot/havocbot/havocbot.qc | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.2