]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/roles.qc
Merge remote-tracking branch 'origin/terencehill/cmd_fixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / roles.qc
index d0c10651b88134d364377b5f8edb641658710ad7..ad3bb2367418f611d13bb67725c70cd416d7831f 100644 (file)
@@ -85,8 +85,8 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                        if( head.armorvalue && player.armorvalue > self.armorvalue)
                                                continue;
 
-                                       if( head.weapons )
-                                       if( (player.weapons & head.weapons) != head.weapons)
+                                       if( !WEPSET_EMPTY_E(head) )
+                                       if( !WEPSET_CONTAINS_ALL_EE(player, head) )
                                                continue;
 
                                        if (head.ammo_shells && player.ammo_shells > self.ammo_shells)
@@ -162,21 +162,12 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
        FOR_EACH_PLAYER(head)
        {
                // TODO: Merge this logic with the bot_shouldattack function
-               if (self != head)
-               if (head.health > 0)
-               if ((noteam && (!bot_ignore_bots || clienttype(head) == CLIENTTYPE_REAL)) || head.team != self.team)
+               if(bot_shouldattack(head))
                {
                        distance = vlen(head.origin - org);
                        if (distance < 100 || distance > sradius)
                                continue;
 
-                       if (head.freezetag_frozen)
-                               continue;
-
-                       if(g_minstagib)
-                       if(head.items & IT_STRENGTH)
-                               continue;
-
                        // rate only visible enemies
                        /*
                        traceline(self.origin + self.view_ofs, head.origin, MOVE_NOMONSTERS, self);
@@ -302,8 +293,8 @@ void havocbot_chooserole()
 {
        dprint("choosing a role...\n");
        self.bot_strategytime = 0;
-       if (g_ctf)
-               havocbot_chooserole_ctf();
+       if (MUTATOR_CALLHOOK(HavocBot_ChooseRule))
+               return;
        else if (g_domination)
                havocbot_chooserole_dom();
        else if (g_keyhunt)
@@ -312,10 +303,6 @@ void havocbot_chooserole()
                havocbot_chooserole_race();
        else if (g_onslaught)
                havocbot_chooserole_ons();
-       else if (g_keepaway)
-               havocbot_chooserole_ka();
-       else if (g_freezetag)
-               havocbot_chooserole_ft();
        else if (g_assault)
                havocbot_chooserole_ast();
        else // assume anything else is deathmatch