]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Anticipate bot_wander_enable check
authorterencehill <piuntn@gmail.com>
Mon, 22 Jan 2018 15:38:33 +0000 (16:38 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 22 Jan 2018 15:38:33 +0000 (16:38 +0100)
qcsrc/server/bot/default/navigation.qc

index 2bf04bac261aa9b40168000f1e846ccf85b2dc11..7b80a1a6f27cfd790fb59f325f8eda9404dfbcf9 100644 (file)
@@ -1808,6 +1808,9 @@ void botframe_updatedangerousobjects(float maxupdate)
 
 void navigation_unstuck(entity this)
 {
+       if (!autocvar_bot_wander_enable)
+               return;
+
        bool has_user_waypoints = false;
        IL_EACH(g_waypoints, !(it.wpflags & WAYPOINTFLAG_GENERATED),
        {
@@ -1819,9 +1822,6 @@ void navigation_unstuck(entity this)
 
        float search_radius = 1000;
 
-       if (!autocvar_bot_wander_enable)
-               return;
-
        if (!bot_waypoint_queue_owner)
        {
                LOG_DEBUG(this.netname, " stuck, taking over the waypoints queue");