]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only avoid a reload scheduled weapon if our current one has ammo. If we're out of...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:17:49 +0000 (01:17 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:17:49 +0000 (01:17 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

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