-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Don't panic when applying an Insert
command
#9379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should at least warn here: this is pretty important potential bug.
My preferred solution though is to create a class of try_verb
commands though, which fail silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would at least make it log an error, so that you can still see when this is happening.
If we log an error or warning here, we'd basically be indicating that any occurrence of this situation is a bug that should be resolved, and I'm not convinced that that is correct. I'm currently running into this panic because I am despawning entities in the The panic of course does not happen reliably, because the entity is only rarely despawned on the same frame as the From what I can tell, most people running into this panic end up in a similar situation, where the correct resolution is to simply ignore the Perhaps the "bug" would be that bevy's internals need to use |
This would also fix #9721 |
This was added as opt-in behavior in #9844. |
Were bevy's internal systems ever fixed to use it? |
No, I would appreciate issues for the places where this is the correct choice :) Or a single issue might be fine and the implementor can track them down. We just ran into one over in #9721, and I suspect that there's more to fix. |
Objective
Solution
EntityCommands::insert
, by ignoring the command if its entity has been despawnedChangelog
Insert
command now no longer panics when its entity no longer exists.