mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
Merge pull request #67939 from sambriels/emit-signal-after-target-reached
[NavigationAgent2D/3D]: target_reached signal is emitted before internal state is updated
This commit is contained in:
commit
4dc2c8ae6f
@ -478,8 +478,8 @@ void NavigationAgent2D::_request_repath() {
|
||||
void NavigationAgent2D::_check_distance_to_target() {
|
||||
if (!target_reached) {
|
||||
if (distance_to_target() < target_desired_distance) {
|
||||
emit_signal(SNAME("target_reached"));
|
||||
target_reached = true;
|
||||
emit_signal(SNAME("target_reached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -495,8 +495,8 @@ void NavigationAgent3D::_request_repath() {
|
||||
void NavigationAgent3D::_check_distance_to_target() {
|
||||
if (!target_reached) {
|
||||
if (distance_to_target() < target_desired_distance) {
|
||||
emit_signal(SNAME("target_reached"));
|
||||
target_reached = true;
|
||||
emit_signal(SNAME("target_reached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user