]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Write that last code in a better way
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:06:13 +0000 (01:06 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:06:13 +0000 (01:06 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 6fe6d2059155c5a06c8af773cee0ab0bf73a808e..67e076f5c4bd6328315cf5651aa61dd593577b61 100644 (file)
@@ -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;