From c143b5c6770c690e46545e17c7b28bee698e5a3a Mon Sep 17 00:00:00 2001 From: Andrea Catania Date: Wed, 26 Feb 2020 09:42:51 +0100 Subject: Flushes commands just before the navigation server is destroyed --- main/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main/main.cpp') diff --git a/main/main.cpp b/main/main.cpp index efcbf04585..4b86eb91a1 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -203,6 +203,7 @@ void finalize_physics() { void initialize_navigation_server() { ERR_FAIL_COND(navigation_server != NULL); + navigation_server = NavigationServerManager::new_default_server(); navigation_2d_server = memnew(Navigation2DServer); } @@ -210,6 +211,7 @@ void initialize_navigation_server() { void finalize_navigation_server() { memdelete(navigation_server); navigation_server = NULL; + memdelete(navigation_2d_server); navigation_2d_server = NULL; } @@ -2037,9 +2039,9 @@ bool Main::iteration() { break; } - message_queue->flush(); + NavigationServer::get_singleton_mut()->process(frame_slice * time_scale); - NavigationServer::get_singleton_mut()->step(frame_slice * time_scale); + message_queue->flush(); PhysicsServer::get_singleton()->step(frame_slice * time_scale); -- cgit v1.2.3