]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/havocbot.qc
get rid of all direct use of weapon sets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / havocbot.qc
index 3aefc45a75323b45782bea68f59dacc6b986e490..18e4341718e67e698e12c76045a8d035418e8af8 100644 (file)
@@ -94,7 +94,7 @@ void havocbot_ai()
                self.aistatus |= AI_STATUS_ATTACKING;
                self.aistatus &~= AI_STATUS_ROAMING;
 
-               if(self.weapons)
+               if(!WEPSET_EMPTY_E(self))
                {
                        weapon_action(self.weapon, WR_AIM);
                        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
@@ -168,7 +168,7 @@ void havocbot_ai()
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               if ((self.weapons & W_WeaponBit(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
+                               if (WEPSET_CONTAINS_EW(self, i) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
                                        self.switchweapon = i;
                        }
                }
@@ -930,7 +930,7 @@ void havocbot_chooseenemy()
 
                // I want to do a second scan if no enemy was found or I don't have weapons
                // TODO: Perform the scan when using the rifle (requires changes on the rifle code)
-               if(best || self.weapons) // || self.weapon == WEP_RIFLE
+               if(best || !WEPSET_EMPTY_E(self)) // || self.weapon == WEP_RIFLE
                        break;
                if(i)
                        break;
@@ -979,7 +979,7 @@ void havocbot_chooseweapon()
        float i;
 
        // ;)
-       if(g_weaponarena == WEPBIT_TUBA)
+       if(WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
        {
                self.switchweapon = WEP_TUBA;
                return;