From d079c036659292d5e043f8d8d32df3909fae1f89 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 12 Feb 2011 01:06:13 +0200 Subject: [PATCH] Write that last code in a better way --- qcsrc/server/bot/havocbot/havocbot.qc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 6fe6d2059..67e076f5c 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -1005,8 +1005,9 @@ void havocbot_chooseweapon() for(i=0; i < WEP_COUNT && bot_weapons_far[i] != -1 ; ++i){ w = bot_weapons_far[i]; if ( client_hasweapon(self, w, TRUE, FALSE) ) - if not (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat { + if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + continue; if ( self.weapon == w && combo) continue; self.switchweapon = w; @@ -1020,8 +1021,9 @@ void havocbot_chooseweapon() for(i=0; i < WEP_COUNT && bot_weapons_mid[i] != -1 ; ++i){ w = bot_weapons_mid[i]; if ( client_hasweapon(self, w, TRUE, FALSE) ) - if not (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat { + if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + continue; if ( self.weapon == w && combo) continue; self.switchweapon = w; @@ -1034,8 +1036,9 @@ void havocbot_chooseweapon() for(i=0; i < WEP_COUNT && bot_weapons_close[i] != -1 ; ++i){ w = bot_weapons_close[i]; if ( client_hasweapon(self, w, TRUE, FALSE) ) - if not (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat { + if (self.weapon_load[w] < 0) // this weapon is scheduled for reloading, don't switch to it during combat + continue; if ( self.weapon == w && combo) continue; self.switchweapon = w; -- 2.39.2