]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
simplify bot-should-attack logic (PLEASE TEST)
authorRudolf Polzer <divverent@xonotic.org>
Fri, 28 Oct 2011 21:45:19 +0000 (23:45 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 28 Oct 2011 21:45:19 +0000 (23:45 +0200)
qcsrc/server/bot/havocbot/roles.qc

index d0c10651b88134d364377b5f8edb641658710ad7..91eb2ec1a5afbce4132a566baa3c2d115f480edc 100644 (file)
@@ -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);