]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reintroduce periodic recalculation of nearest waypoint of static items but only while...
authorterencehill <piuntn@gmail.com>
Sat, 18 Mar 2017 23:32:08 +0000 (00:32 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 18 Mar 2017 23:32:08 +0000 (00:32 +0100)
qcsrc/server/bot/default/navigation.qc

index 75ddd15f5dabcb10bcdde3d132a28e9c1f4e7edb..b0953089819843403abd957073f7cb3d48fd0a9e 100644 (file)
@@ -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;
        }