diff options
Diffstat (limited to 'servers/navigation_server_3d.cpp')
-rw-r--r-- | servers/navigation_server_3d.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp index 70897ae75c..02460bdb18 100644 --- a/servers/navigation_server_3d.cpp +++ b/servers/navigation_server_3d.cpp @@ -29,7 +29,6 @@ /**************************************************************************/ #include "navigation_server_3d.h" - #include "core/config/project_settings.h" NavigationServer3D *NavigationServer3D::singleton = nullptr; @@ -186,17 +185,6 @@ NavigationServer3D::~NavigationServer3D() { singleton = nullptr; } -NavigationServer3DCallback NavigationServer3DManager::create_callback = nullptr; - -void NavigationServer3DManager::set_default_server(NavigationServer3DCallback p_callback) { - create_callback = p_callback; -} - -NavigationServer3D *NavigationServer3DManager::new_default_server() { - ERR_FAIL_COND_V(create_callback == nullptr, nullptr); - return create_callback(); -} - #ifdef DEBUG_ENABLED void NavigationServer3D::_emit_navigation_debug_changed_signal() { if (debug_dirty) { @@ -594,8 +582,6 @@ bool NavigationServer3D::get_debug_navigation_enable_agent_paths_xray() const { #endif // DEBUG_ENABLED -/////////////////////////////////////////////////////// - void NavigationServer3D::query_path(const Ref<NavigationPathQueryParameters3D> &p_query_parameters, Ref<NavigationPathQueryResult3D> p_query_result) const { ERR_FAIL_COND(!p_query_parameters.is_valid()); ERR_FAIL_COND(!p_query_result.is_valid()); @@ -607,3 +593,19 @@ void NavigationServer3D::query_path(const Ref<NavigationPathQueryParameters3D> & p_query_result->set_path_rids(_query_result.path_rids); p_query_result->set_path_owner_ids(_query_result.path_owner_ids); } + +/////////////////////////////////////////////////////// + +NavigationServer3DCallback NavigationServer3DManager::create_callback = nullptr; + +void NavigationServer3DManager::set_default_server(NavigationServer3DCallback p_callback) { + create_callback = p_callback; +} + +NavigationServer3D *NavigationServer3DManager::new_default_server() { + if (create_callback == nullptr) { + return nullptr; + } + + return create_callback(); +} |