-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix infinite loop state check in AnimationStateMachine
#79141
Fix infinite loop state check in AnimationStateMachine
#79141
Conversation
036b144
to
79656d1
Compare
How is the issue communicated to the user when such a potential infinite loop is detected? I see it breaks but doesn't raise an error (here at least, it maybe does further up the stack). Will users understand that their setup is non functional due to recursion? |
79656d1
to
d197a77
Compare
Perhaps the state continues to change every frame, but that is a normal transition and not an error. Since Nodes in StateMachine cannot have a path to itself, if this check works, there is no longer an infinite loop in the true sense of the word. |
d197a77
to
9948ba0
Compare
@akien-mga I've added a warning in case you're concerned. |
72b4c34
to
7b66897
Compare
7b66897
to
fc40ba2
Compare
AnimationStateMachine
AnimationStateMachine
Thanks! |
Cherry-picked for 4.1.1. |
Fixes #79012.
If only the first pass is stored and compared, the loop detection will fail if an infinite loop starts in the middle of the path. So, all transition paths must be stored and compared. Also, remove
is_state_changed = false
as it was actually wrong (state change occurs just before the try infinite loop).