fix: emit target_reached signal after updating state

This commit is contained in:
Sam Briels 2022-10-31 08:14:32 +01:00 committed by Relintai
parent 9e43e62e3b
commit 799a6e334f

View File

@ -492,8 +492,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");
}
}
}