From 975e5c4a9e8bebc9f1d374c144df52c9279f4b28 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 11 Jun 2023 18:32:15 +0200 Subject: [PATCH] Rethink the previous fix. --- scene/2d/navigation_agent_2d.cpp | 8 ++------ scene/2d/navigation_agent_2d.h | 3 +-- scene/2d/navigation_obstacle_2d.cpp | 2 +- scene/2d/navigation_obstacle_2d.h | 3 +-- scene/3d/navigation_agent.cpp | 8 ++------ scene/3d/navigation_agent.h | 3 +-- scene/3d/navigation_obstacle.cpp | 2 +- scene/3d/navigation_obstacle.h | 3 +-- .../navigation/navigation_path_query_parameters_2d.cpp | 2 +- servers/navigation/navigation_path_query_parameters_2d.h | 2 +- .../navigation/navigation_path_query_parameters_3d.cpp | 6 +++--- servers/navigation/navigation_path_query_parameters_3d.h | 6 +++--- 12 files changed, 18 insertions(+), 30 deletions(-) diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 0d199cf46..c66f7fb67 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -98,7 +98,7 @@ void NavigationAgent2D::_bind_methods() { ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent2D::distance_to_target); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent2D::get_current_navigation_result); - ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path_bind); + ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent2D::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent2D::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent2D::is_target_reachable); @@ -596,11 +596,7 @@ Ref NavigationAgent2D::get_current_navigation_resul return navigation_result; } -const Vector &NavigationAgent2D::get_current_navigation_path() const { - return navigation_result->get_path(); -} - -Vector NavigationAgent2D::get_current_navigation_path_bind() const { +Vector NavigationAgent2D::get_current_navigation_path() const { return navigation_result->get_path(); } diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 275b3d839..c1780400b 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -197,8 +197,7 @@ public: Ref get_current_navigation_result() const; - const Vector &get_current_navigation_path() const; - Vector get_current_navigation_path_bind() const; + Vector get_current_navigation_path() const; int get_current_navigation_path_index() const { return nav_path_index; diff --git a/scene/2d/navigation_obstacle_2d.cpp b/scene/2d/navigation_obstacle_2d.cpp index 49937d30d..8e029e6e2 100644 --- a/scene/2d/navigation_obstacle_2d.cpp +++ b/scene/2d/navigation_obstacle_2d.cpp @@ -52,7 +52,7 @@ void NavigationObstacle2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle2D::get_velocity); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle2D::set_vertices); - ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices_bind); + ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle2D::set_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle2D::get_avoidance_layers); diff --git a/scene/2d/navigation_obstacle_2d.h b/scene/2d/navigation_obstacle_2d.h index d3377f915..6d333035a 100644 --- a/scene/2d/navigation_obstacle_2d.h +++ b/scene/2d/navigation_obstacle_2d.h @@ -92,8 +92,7 @@ public: } void set_vertices(const Vector &p_vertices); - const Vector &get_vertices() const { return vertices; }; - Vector get_vertices_bind() const { return vertices; }; + Vector get_vertices() const { return vertices; }; void set_avoidance_layers(uint32_t p_layers); uint32_t get_avoidance_layers() const; diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index aef3a54a2..045ebe57c 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -111,7 +111,7 @@ void NavigationAgent::_bind_methods() { ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent::distance_to_target); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent::get_current_navigation_result); - ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path_bind); + ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent::is_target_reachable); @@ -573,11 +573,7 @@ Ref NavigationAgent::get_current_navigation_result( return navigation_result; } -const Vector &NavigationAgent::get_current_navigation_path() const { - return navigation_result->get_path(); -} - -Vector NavigationAgent::get_current_navigation_path_bind() const { +Vector NavigationAgent::get_current_navigation_path() const { return navigation_result->get_path(); } diff --git a/scene/3d/navigation_agent.h b/scene/3d/navigation_agent.h index 5ca880aae..f41cf7237 100644 --- a/scene/3d/navigation_agent.h +++ b/scene/3d/navigation_agent.h @@ -222,8 +222,7 @@ public: Ref get_current_navigation_result() const; - const Vector &get_current_navigation_path() const; - Vector get_current_navigation_path_bind() const; + Vector get_current_navigation_path() const; int get_current_navigation_path_index() const { return nav_path_index; diff --git a/scene/3d/navigation_obstacle.cpp b/scene/3d/navigation_obstacle.cpp index 9fdb2c260..e8bc0096a 100644 --- a/scene/3d/navigation_obstacle.cpp +++ b/scene/3d/navigation_obstacle.cpp @@ -62,7 +62,7 @@ void NavigationObstacle::_bind_methods() { ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle::get_velocity); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle::set_vertices); - ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices_bind); + ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle::set_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle::get_avoidance_layers); diff --git a/scene/3d/navigation_obstacle.h b/scene/3d/navigation_obstacle.h index 4cef27b00..e540da444 100644 --- a/scene/3d/navigation_obstacle.h +++ b/scene/3d/navigation_obstacle.h @@ -105,8 +105,7 @@ public: real_t get_height() const { return height; } void set_vertices(const Vector &p_vertices); - const Vector &get_vertices() const { return vertices; }; - Vector get_vertices_bind() const { return vertices; }; + Vector get_vertices() const { return vertices; }; void set_avoidance_layers(uint32_t p_layers); uint32_t get_avoidance_layers() const; diff --git a/servers/navigation/navigation_path_query_parameters_2d.cpp b/servers/navigation/navigation_path_query_parameters_2d.cpp index 5ddb50fcc..e13079edd 100644 --- a/servers/navigation/navigation_path_query_parameters_2d.cpp +++ b/servers/navigation/navigation_path_query_parameters_2d.cpp @@ -83,7 +83,7 @@ void NavigationPathQueryParameters2D::set_map(const RID &p_map) { parameters.map = p_map; } -const RID &NavigationPathQueryParameters2D::get_map() const { +const RID NavigationPathQueryParameters2D::get_map() const { return parameters.map; } diff --git a/servers/navigation/navigation_path_query_parameters_2d.h b/servers/navigation/navigation_path_query_parameters_2d.h index 938cbcfa2..c29e0f6c8 100644 --- a/servers/navigation/navigation_path_query_parameters_2d.h +++ b/servers/navigation/navigation_path_query_parameters_2d.h @@ -70,7 +70,7 @@ public: PathPostProcessing get_path_postprocessing() const; void set_map(const RID &p_map); - const RID &get_map() const; + const RID get_map() const; void set_start_position(const Vector2 p_start_position); Vector2 get_start_position() const; diff --git a/servers/navigation/navigation_path_query_parameters_3d.cpp b/servers/navigation/navigation_path_query_parameters_3d.cpp index 856824131..817c2c00e 100644 --- a/servers/navigation/navigation_path_query_parameters_3d.cpp +++ b/servers/navigation/navigation_path_query_parameters_3d.cpp @@ -83,7 +83,7 @@ void NavigationPathQueryParameters3D::set_map(const RID &p_map) { parameters.map = p_map; } -const RID &NavigationPathQueryParameters3D::get_map() const { +const RID NavigationPathQueryParameters3D::get_map() const { return parameters.map; } @@ -91,7 +91,7 @@ void NavigationPathQueryParameters3D::set_start_position(const Vector3 &p_start_ parameters.start_position = p_start_position; } -const Vector3 &NavigationPathQueryParameters3D::get_start_position() const { +const Vector3 NavigationPathQueryParameters3D::get_start_position() const { return parameters.start_position; } @@ -99,7 +99,7 @@ void NavigationPathQueryParameters3D::set_target_position(const Vector3 &p_targe parameters.target_position = p_target_position; } -const Vector3 &NavigationPathQueryParameters3D::get_target_position() const { +const Vector3 NavigationPathQueryParameters3D::get_target_position() const { return parameters.target_position; } diff --git a/servers/navigation/navigation_path_query_parameters_3d.h b/servers/navigation/navigation_path_query_parameters_3d.h index 089a79cd2..0037c6acd 100644 --- a/servers/navigation/navigation_path_query_parameters_3d.h +++ b/servers/navigation/navigation_path_query_parameters_3d.h @@ -69,13 +69,13 @@ public: PathPostProcessing get_path_postprocessing() const; void set_map(const RID &p_map); - const RID &get_map() const; + const RID get_map() const; void set_start_position(const Vector3 &p_start_position); - const Vector3 &get_start_position() const; + const Vector3 get_start_position() const; void set_target_position(const Vector3 &p_target_position); - const Vector3 &get_target_position() const; + const Vector3 get_target_position() const; void set_navigation_layers(uint32_t p_navigation_layers); uint32_t get_navigation_layers() const;