From: terencehill Date: Sat, 28 Oct 2017 22:47:34 +0000 (+0200) Subject: Assume nearest waypoint of a bot is its current goal waypoint (good as feature but... X-Git-Tag: xonotic-v0.8.5~2378^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d6d608850c39140765faba78d39b74de8e81e9e8;p=xonotic%2Fxonotic-data.pk3dir.git Assume nearest waypoint of a bot is its current goal waypoint (good as feature but also as optimization) --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 61079576a..135b5fc68 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1237,7 +1237,10 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) if ((!e.nearestwaypoint || e.navigation_dynamicgoal) && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout) { - e.nearestwaypoint = nwp = navigation_findnearestwaypoint(e, true); + if(IS_BOT_CLIENT(e) && e.goalcurrent && e.goalcurrent.classname == "waypoint") + e.nearestwaypoint = nwp = e.goalcurrent; + else + e.nearestwaypoint = nwp = navigation_findnearestwaypoint(e, true); if(!nwp) { LOG_DEBUG("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e));