diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-22 11:08:57 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-22 11:08:57 +0100 |
commit | 285e6ed9a536d8ec6fc2144395dc26131ba60b89 (patch) | |
tree | f247c46a65452d38115bf9be098e547dfde5472c /scene | |
parent | c0f35a8db129e01507eacb424a46cbbeb978d68a (diff) | |
parent | a6d8afc90ceb56a8bcb8b98efdd8a4ee5ff40b11 (diff) |
Merge pull request #71840 from TokageItLab/fix-travel-reset
Fix weird behavior of teleporting to self-state when `reset_on_teleport` is `false` in StateMachine
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index b1a8155359..02f1e9f9a6 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -411,9 +411,11 @@ double AnimationNodeStateMachinePlayback::_process(AnimationNodeStateMachine *p_ // can't travel, then teleport if (p_state_machine->states.has(travel_request)) { path.clear(); - current = travel_request; - play_start = true; - reset_request = reset_request_on_teleport; + if (current != travel_request || reset_request_on_teleport) { + current = travel_request; + play_start = true; + reset_request = reset_request_on_teleport; + } } else { StringName node = travel_request; travel_request = StringName(); |