From 0ff2bbdf70c6b6f120441f944222a6a889eda6da Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 5 Sep 2023 11:58:36 +0200 Subject: [PATCH] Make sure that all parameters are properly set into PathQueryResults. --- servers/navigation/navigation_path_query_result_2d.cpp | 7 +++++++ servers/navigation/navigation_path_query_result_2d.h | 2 ++ servers/navigation/navigation_path_query_result_3d.cpp | 7 +++++++ servers/navigation/navigation_path_query_result_3d.h | 2 ++ servers/navigation_2d_server.cpp | 2 +- servers/navigation_server.cpp | 5 +---- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/servers/navigation/navigation_path_query_result_2d.cpp b/servers/navigation/navigation_path_query_result_2d.cpp index fd27418b3..626ad23cf 100644 --- a/servers/navigation/navigation_path_query_result_2d.cpp +++ b/servers/navigation/navigation_path_query_result_2d.cpp @@ -81,6 +81,13 @@ Array NavigationPathQueryResult2D::get_path_owner_ids_bind() const { return ret; } +void NavigationPathQueryResult2D::set_from_query_result(const NavigationUtilities::PathQueryResult2D &p_result) { + path = p_result.path; + path_types = p_result.path_types; + path_rids = p_result.path_rids; + path_owner_ids = p_result.path_owner_ids; +} + void NavigationPathQueryResult2D::reset() { path.clear(); path_types.clear(); diff --git a/servers/navigation/navigation_path_query_result_2d.h b/servers/navigation/navigation_path_query_result_2d.h index a2d431b62..c0c007828 100644 --- a/servers/navigation/navigation_path_query_result_2d.h +++ b/servers/navigation/navigation_path_query_result_2d.h @@ -66,6 +66,8 @@ public: void set_path_owner_ids_bind(const Array p_path_owner_ids); Array get_path_owner_ids_bind() const; + void set_from_query_result(const NavigationUtilities::PathQueryResult2D &p_result); + void reset(); }; diff --git a/servers/navigation/navigation_path_query_result_3d.cpp b/servers/navigation/navigation_path_query_result_3d.cpp index caf08f21a..7bb110cde 100644 --- a/servers/navigation/navigation_path_query_result_3d.cpp +++ b/servers/navigation/navigation_path_query_result_3d.cpp @@ -81,6 +81,13 @@ Array NavigationPathQueryResult3D::get_path_owner_ids_bind() const { return ret; } +void NavigationPathQueryResult3D::set_from_query_result(const NavigationUtilities::PathQueryResult &p_result) { + path = p_result.path; + path_types = p_result.path_types; + path_rids = p_result.path_rids; + path_owner_ids = p_result.path_owner_ids; +} + void NavigationPathQueryResult3D::reset() { path.clear(); path_types.clear(); diff --git a/servers/navigation/navigation_path_query_result_3d.h b/servers/navigation/navigation_path_query_result_3d.h index 8e49d3e1d..7708f3030 100644 --- a/servers/navigation/navigation_path_query_result_3d.h +++ b/servers/navigation/navigation_path_query_result_3d.h @@ -67,6 +67,8 @@ public: void set_path_owner_ids_bind(const Array p_path_owner_ids); Array get_path_owner_ids_bind() const; + void set_from_query_result(const NavigationUtilities::PathQueryResult &p_result); + void reset(); }; diff --git a/servers/navigation_2d_server.cpp b/servers/navigation_2d_server.cpp index 9d1f85529..61ee168b0 100644 --- a/servers/navigation_2d_server.cpp +++ b/servers/navigation_2d_server.cpp @@ -166,7 +166,7 @@ void Navigation2DServer::query_path(const Ref & const NavigationUtilities::PathQueryResult2D _query_result = _query_path(p_query_parameters->get_parameters()); - p_query_result->set_path(_query_result.path); + p_query_result->set_from_query_result(_query_result); } Navigation2DServer::Navigation2DServer() { diff --git a/servers/navigation_server.cpp b/servers/navigation_server.cpp index 362b9692f..9231867d0 100644 --- a/servers/navigation_server.cpp +++ b/servers/navigation_server.cpp @@ -909,10 +909,7 @@ void NavigationServer::query_path(const Ref &p_ const NavigationUtilities::PathQueryResult _query_result = _query_path(p_query_parameters->get_parameters()); - p_query_result->set_path(_query_result.path); - p_query_result->set_path_types(_query_result.path_types); - p_query_result->set_path_rids(_query_result.path_rids); - p_query_result->set_path_owner_ids(_query_result.path_owner_ids); + p_query_result->set_from_query_result(_query_result); } Vector NavigationServerManager::navigation_servers;