Skip to content

Commit

Permalink
Merge pull request #71840 from TokageItLab/fix-travel-reset
Browse files Browse the repository at this point in the history
Fix weird behavior of teleporting to self-state when `reset_on_teleport` is `false` in StateMachine
  • Loading branch information
akien-mga committed Jan 22, 2023
2 parents c0f35a8 + a6d8afc commit 285e6ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scene/animation/animation_node_state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 285e6ed

Please sign in to comment.