Merge pull request #68072 from sambriels/backport-of-pull-request-67939

fix: emit target_reached signal after updating state
This commit is contained in:
Rémi Verschelde 2022-10-31 14:00:49 +01:00
commit 9f4d767514
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

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