From: terencehill Date: Wed, 15 Nov 2017 23:44:13 +0000 (+0100) Subject: Check distance of the goal from the previous waypoint but 2 before removing nearest... X-Git-Tag: xonotic-v0.8.5~2378^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6d8e01d3b55017361f564e65ce91179c10e58a96;p=xonotic%2Fxonotic-data.pk3dir.git Check distance of the goal from the previous waypoint but 2 before removing nearest waypoint of a dynamic goal from the route --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 71666aacd..a0295a7ae 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1474,6 +1474,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition) { set_tracewalk_dest(this.goalentity, nearest_wp.enemy.origin, true); if (trace_ent == this || (vdist(tracewalk_dest - nearest_wp.enemy.origin, <, 1050) + && vlen2(tracewalk_dest - nearest_wp.enemy.origin) < vlen2(nearest_wp.origin - nearest_wp.enemy.origin) && tracewalk(this, nearest_wp.enemy.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), tracewalk_dest, tracewalk_dest_height, bot_navigation_movemode))) {