]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/bot/havocbot/havocbot.qc
Get VoreTournament code to compile with gmqcc. To be compiled with the same parameter...
[voretournament/voretournament.git] / data / qcsrc / server / bot / havocbot / havocbot.qc
index 1e29e5319f5a639c681066fc939cca37fd0e5c47..72adda8a888ed1113b5a5d94db3d82e5a5516c29 100644 (file)
@@ -16,8 +16,6 @@ void havocbot_ai()
 
        // execute the vore AI for bots
        Vore_AI();
-       if(self.stat_eaten)
-               return; // an eaten bot has nothing to do outside of the vore AI
 
        if (bot_strategytoken == self)
        if (!bot_strategytoken_taken)
@@ -83,6 +81,8 @@ void havocbot_ai()
 
        if(self.deadflag != DEAD_NO)
                return;
+       if(self.stat_eaten)
+               return; // a prey bot has nothing to do from here on
 
        havocbot_chooseenemy();
        if (self.bot_chooseweapontime < time )
@@ -171,7 +171,7 @@ void havocbot_ai()
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               if ((e.spawnflags & WEP_FLAG_RELOADABLE) && self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+                               if ((self.weapons & W_WeaponBit(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
                                        self.switchweapon = i;
                        }
                }
@@ -947,7 +947,7 @@ void havocbot_chooseweapon()
        {
                // If no weapon was chosen get the first available weapon
                if(self.weapon==0)
-               for(i=WEP_GRABBER + 1; i < WEP_COUNT ; ++i)
+               for(i = WEP_FIRST; i <= WEP_COUNT ; ++i)
                {
                        if(client_hasweapon(self, i, TRUE, FALSE))
                        {
@@ -1034,7 +1034,7 @@ void havocbot_chooseweapon()
                }
        }
 
-#ifdef 0
+#if 0
        // TODO: This disabled code is not working well and got replaced by custom weapon priorities.
        // However, this logic should be refactored and moved to weapons code so each new weapon can be
        // evaluated dynamically by bots without updating the "ai" or config files.     --mand1nga