Make sure that all parameters are properly set into PathQueryResults.

This commit is contained in:
Relintai 2023-09-05 11:58:36 +02:00
parent 176a0e129c
commit 0ff2bbdf70
6 changed files with 20 additions and 5 deletions

View File

@ -81,6 +81,13 @@ Array NavigationPathQueryResult2D::get_path_owner_ids_bind() const {
return ret; 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() { void NavigationPathQueryResult2D::reset() {
path.clear(); path.clear();
path_types.clear(); path_types.clear();

View File

@ -66,6 +66,8 @@ public:
void set_path_owner_ids_bind(const Array p_path_owner_ids); void set_path_owner_ids_bind(const Array p_path_owner_ids);
Array get_path_owner_ids_bind() const; Array get_path_owner_ids_bind() const;
void set_from_query_result(const NavigationUtilities::PathQueryResult2D &p_result);
void reset(); void reset();
}; };

View File

@ -81,6 +81,13 @@ Array NavigationPathQueryResult3D::get_path_owner_ids_bind() const {
return ret; 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() { void NavigationPathQueryResult3D::reset() {
path.clear(); path.clear();
path_types.clear(); path_types.clear();

View File

@ -67,6 +67,8 @@ public:
void set_path_owner_ids_bind(const Array p_path_owner_ids); void set_path_owner_ids_bind(const Array p_path_owner_ids);
Array get_path_owner_ids_bind() const; Array get_path_owner_ids_bind() const;
void set_from_query_result(const NavigationUtilities::PathQueryResult &p_result);
void reset(); void reset();
}; };

View File

@ -166,7 +166,7 @@ void Navigation2DServer::query_path(const Ref<NavigationPathQueryParameters2D> &
const NavigationUtilities::PathQueryResult2D _query_result = _query_path(p_query_parameters->get_parameters()); 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() { Navigation2DServer::Navigation2DServer() {

View File

@ -909,10 +909,7 @@ void NavigationServer::query_path(const Ref<NavigationPathQueryParameters3D> &p_
const NavigationUtilities::PathQueryResult _query_result = _query_path(p_query_parameters->get_parameters()); const NavigationUtilities::PathQueryResult _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);
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);
} }
Vector<NavigationServerManager::ClassInfo> NavigationServerManager::navigation_servers; Vector<NavigationServerManager::ClassInfo> NavigationServerManager::navigation_servers;