From a2c20325df34f72c608112f1f15813ef275af0af Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 19 Mar 2017 00:32:08 +0100 Subject: [PATCH] Reintroduce periodic recalculation of nearest waypoint of static items but only while editing waypoints so that bots behave correctly after a waypoint creation / addition --- qcsrc/server/bot/default/navigation.qc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 75ddd15f5..b09530898 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -853,6 +853,9 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) } else { + if(autocvar_g_waypointeditor && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout) + e.nearestwaypoint = NULL; + if ((!e.nearestwaypoint || e.navigation_dynamicgoal) && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout) { @@ -875,6 +878,8 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) if(e.navigation_dynamicgoal) e.nearestwaypointtimeout = time + 2; + else if(autocvar_g_waypointeditor) + e.nearestwaypointtimeout = time + 3 + random() * 2; } nwp = e.nearestwaypoint; } -- 2.39.2