mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Move the line of infinity loop checking in AnimationStateMachine
(cherry picked from commit b8d555c74b
)
This commit is contained in:
parent
5e7607a6d6
commit
3e968fd8ae
1 changed files with 5 additions and 4 deletions
|
@ -924,15 +924,16 @@ bool AnimationNodeStateMachinePlayback::_transition_to_next_recursive(AnimationT
|
||||||
transition_path.push_back(current);
|
transition_path.push_back(current);
|
||||||
while (true) {
|
while (true) {
|
||||||
next = _find_next(p_tree, p_state_machine);
|
next = _find_next(p_tree, p_state_machine);
|
||||||
if (transition_path.has(next.node)) {
|
|
||||||
WARN_PRINT_ONCE_ED("AnimationNodeStateMachinePlayback: " + base_path + "playback aborts the transition by detecting one or more looped transitions in the same frame to prevent to infinity loop. You may need to check the transition settings.");
|
|
||||||
break; // Maybe infinity loop, do nothing more.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_can_transition_to_next(p_tree, p_state_machine, next, p_test_only)) {
|
if (!_can_transition_to_next(p_tree, p_state_machine, next, p_test_only)) {
|
||||||
break; // Finish transition.
|
break; // Finish transition.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (transition_path.has(next.node)) {
|
||||||
|
WARN_PRINT_ONCE_ED("AnimationNodeStateMachinePlayback: " + base_path + "playback aborts the transition by detecting one or more looped transitions in the same frame to prevent to infinity loop. You may need to check the transition settings.");
|
||||||
|
break; // Maybe infinity loop, do nothing more.
|
||||||
|
}
|
||||||
|
|
||||||
transition_path.push_back(next.node);
|
transition_path.push_back(next.node);
|
||||||
is_state_changed = true;
|
is_state_changed = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue