]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Assume nearest waypoint of a bot is its current goal waypoint (good as feature but...
authorterencehill <piuntn@gmail.com>
Sat, 28 Oct 2017 22:47:34 +0000 (00:47 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 28 Oct 2017 22:47:34 +0000 (00:47 +0200)
qcsrc/server/bot/default/navigation.qc

index 61079576a90c190b5ae94b1553f25ef7b7ac4d85..135b5fc68214c95e27e0fe21593fb9a12a915026 100644 (file)
@@ -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));