diff options
Diffstat (limited to 'scene/2d/navigation_agent_2d.cpp')
-rw-r--r-- | scene/2d/navigation_agent_2d.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 6aeaf300d1..1b3b0bcef0 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -560,7 +560,7 @@ Vector2 NavigationAgent2D::get_next_path_position() { const Vector<Vector2> &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { - ERR_FAIL_COND_V_MSG(agent_parent == nullptr, Vector2(), "The agent has no parent."); + ERR_FAIL_NULL_V_MSG(agent_parent, Vector2(), "The agent has no parent."); return agent_parent->get_global_position(); } else { return navigation_path[navigation_path_index]; @@ -568,7 +568,7 @@ Vector2 NavigationAgent2D::get_next_path_position() { } real_t NavigationAgent2D::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); } |