]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: don't rate enemies running too fast for chasing them
authorterencehill <piuntn@gmail.com>
Sat, 28 Oct 2017 17:06:16 +0000 (19:06 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 28 Oct 2017 17:06:16 +0000 (19:06 +0200)
qcsrc/server/bot/default/havocbot/roles.qc

index 54129e25d2d5bcf40b9a8ed88cd2d0a28a9c330a..df5e19d98652328242a2d2d69d0cdfe6950c5c3b 100644 (file)
@@ -188,6 +188,8 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org
                // TODO: Merge this logic with the bot_shouldattack function
                if(vdist(it.origin - org, <, 100) || vdist(it.origin - org, >, sradius))
                        continue;
+               if(vdist(vec2(it.velocity), >, autocvar_sv_maxspeed * 2))
+                       continue;
 
                // rate only visible enemies
                /*