diff options
author | Andrea Catania <info@andreacatania.com> | 2020-02-26 09:42:51 +0100 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2020-02-26 09:42:51 +0100 |
commit | c143b5c6770c690e46545e17c7b28bee698e5a3a (patch) | |
tree | bc84666863baaba727b7956a744ff1f162cc0ca4 /main/main.cpp | |
parent | 2ca5f22bcea8fdbc8b490d9e8757573196578f5d (diff) |
Flushes commands just before the navigation server is destroyed
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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); |