-
Notifications
You must be signed in to change notification settings - Fork 27
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
Stage::run::<StateTransitionStage>()
causes the initial state to exit and enter again on first run
#10
Comments
Ways to fix this:
|
If we're asking the user to insert a resource to transition, I would personally expect the existence of the |
That was the behavior in 0.1. I changed it, because "repeatedly inserting and removing a resource" (effectively "using a resource as an event") felt weird to me. But you are right, why not, it makes sense. In retrospect, if we are gonna use a resource to trigger a transition, that makes more sense. I guess I should bring it back. |
OK, reverted back to the 0.1 states behavior, except now without the I consider this bug important enough that I decided to release a |
I confirmed that the fix works. Only the initial state's enter stage is run at the start, and it only ran once. |
By setting NextState on first run in line 122 in
state.rs
the initial state will be switched to itself, thus triggering the exit and enter stages. If exit and enter are expensive (e.g. procedural generation) it will cause needless processing.Link:
iyes_loopless/src/state.rs
Line 122 in cf8e61b
The text was updated successfully, but these errors were encountered: