fix: emit target_reached signal after updating state

(cherry picked from commit 3e186ae043)
This commit is contained in:
Sam Briels 2022-10-31 08:14:32 +01:00 committed by Haoyu Qiu
parent 568401878f
commit 1f50a0b6ca

View file

@ -481,8 +481,8 @@ void NavigationAgent2D::_request_repath() {
void NavigationAgent2D::_check_distance_to_target() {
if (!target_reached) {
if (distance_to_target() < target_desired_distance) {
emit_signal("target_reached");
target_reached = true;
emit_signal("target_reached");
}
}
}