Browse Source

Move NavigationServer navmesh sync from main() to process()

Moves NavigationServer navmesh sync from main() to process().
smix8 5 months ago
parent
commit
a4c56d478a

+ 0 - 7
main/main.cpp

@@ -4602,13 +4602,6 @@ bool Main::iteration() {
 	XRServer::get_singleton()->_process();
 #endif // XR_DISABLED
 
-#ifndef NAVIGATION_2D_DISABLED
-	NavigationServer2D::get_singleton()->sync();
-#endif // NAVIGATION_2D_DISABLED
-#ifndef NAVIGATION_3D_DISABLED
-	NavigationServer3D::get_singleton()->sync();
-#endif // NAVIGATION_3D_DISABLED
-
 	for (int iters = 0; iters < advance.physics_steps; ++iters) {
 		if (Input::get_singleton()->is_agile_input_event_flushing()) {
 			Input::get_singleton()->flush_buffered_events();

+ 2 - 0
modules/navigation_2d/2d/godot_navigation_server_2d.cpp

@@ -1262,6 +1262,8 @@ void GodotNavigationServer2D::process(double p_delta_time) {
 	// Will run reliably every rendered frame independent of the physics tick rate.
 	// Use for things that (only) need to update once per main loop iteration and rendered frame or is visible to the user.
 	// E.g. (final) sync of objects for this main loop iteration, updating rendered debug visuals, updating debug statistics, ...
+
+	sync();
 }
 
 void GodotNavigationServer2D::physics_process(double p_delta_time) {

+ 2 - 0
modules/navigation_3d/3d/godot_navigation_server_3d.cpp

@@ -1343,6 +1343,8 @@ void GodotNavigationServer3D::process(double p_delta_time) {
 	// Will run reliably every rendered frame independent of the physics tick rate.
 	// Use for things that (only) need to update once per main loop iteration and rendered frame or is visible to the user.
 	// E.g. (final) sync of objects for this main loop iteration, updating rendered debug visuals, updating debug statistics, ...
+
+	sync();
 }
 
 void GodotNavigationServer3D::physics_process(double p_delta_time) {