From ac4cb770422c8abf5dfb33f7c0fcb41604f31b5b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 28 Oct 2011 23:45:19 +0200 Subject: [PATCH] simplify bot-should-attack logic (PLEASE TEST) --- qcsrc/server/bot/havocbot/roles.qc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc index d0c10651b..91eb2ec1a 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -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); -- 2.39.2