summaryrefslogtreecommitdiffstats
path: root/scene/3d/navigation_agent_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/navigation_agent_3d.cpp')
-rw-r--r--scene/3d/navigation_agent_3d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp
index 93acf38fa8..3c119671ec 100644
--- a/scene/3d/navigation_agent_3d.cpp
+++ b/scene/3d/navigation_agent_3d.cpp
@@ -602,7 +602,7 @@ Vector3 NavigationAgent3D::get_next_path_position() {
const Vector<Vector3> &navigation_path = navigation_result->get_path();
if (navigation_path.size() == 0) {
- ERR_FAIL_COND_V_MSG(agent_parent == nullptr, Vector3(), "The agent has no parent.");
+ ERR_FAIL_NULL_V_MSG(agent_parent, Vector3(), "The agent has no parent.");
return agent_parent->get_global_position();
} else {
return navigation_path[navigation_path_index] - Vector3(0, path_height_offset, 0);
@@ -610,7 +610,7 @@ Vector3 NavigationAgent3D::get_next_path_position() {
}
real_t NavigationAgent3D::distance_to_target() const {
- ERR_FAIL_COND_V_MSG(agent_parent == nullptr, 0.0, "The agent has no parent.");
+ ERR_FAIL_NULL_V_MSG(agent_parent, 0.0, "The agent has no parent.");
return agent_parent->get_global_position().distance_to(target_position);
}