From: terencehill Date: Sat, 18 Mar 2017 23:32:08 +0000 (+0100) Subject: Reintroduce periodic recalculation of nearest waypoint of static items but only while... X-Git-Tag: xonotic-v0.8.2~33 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a2c20325df34f72c608112f1f15813ef275af0af;p=xonotic%2Fxonotic-data.pk3dir.git Reintroduce periodic recalculation of nearest waypoint of static items but only while editing waypoints so that bots behave correctly after a waypoint creation / addition --- 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; }