]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/roles.qc
Cleanse some uses of self in the bot code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / roles.qc
index d8904de32d9584be339f934498cb10637787617d..a4c769921a108e4728e023312d3c41f51a560861 100644 (file)
@@ -158,13 +158,11 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
        if(self.waterlevel>WATERLEVEL_WETFEET)
                return;
 
-       float distance;
        int t;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && bot_shouldattack(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && bot_shouldattack(self, it), LAMBDA(
                // TODO: Merge this logic with the bot_shouldattack function
-               distance = vlen(it.origin - org);
-               if (distance < 100 || distance > sradius)
+               if(vdist(it.origin - org, <, 100) || vdist(it.origin - org, >, sradius))
                        continue;
 
                // rate only visible enemies