You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the spirit of #649 and #651, I was thinking of removing the unwrap with a log, but that would mean that the other remaining components from the bundle won't be removed which may be an unexpected behaviour for the user.
The other way around this would be, when a bundle fails to remove, to try to remove each component of the bundle one by one, but I'm not sure if that's a good fix...
What do you think?
example code to reproduce the issue
remove_tag1 will never fail even though it just removes Tag1 from every entity, remove_tag12 will crash one Tag1 are removed.
On bevy master, , when removing a bundle from an entity when one of the component has already been removed, it crashes with this
unwrap
: https://github.com/bevyengine/bevy/blob/master/crates/bevy_ecs/src/system/commands.rs#L150When using
remove_one
instead ofremove
to remove a component, it never crashes even if the component is not present on the entity. This is becauseremove_one
checks for the presence of the component before removing it: https://github.com/bevyengine/bevy/blob/master/crates/bevy_ecs/src/system/commands.rs#L129In the spirit of #649 and #651, I was thinking of removing the
unwrap
with a log, but that would mean that the other remaining components from the bundle won't be removed which may be an unexpected behaviour for the user.The other way around this would be, when a bundle fails to remove, to try to remove each component of the bundle one by one, but I'm not sure if that's a good fix...
What do you think?
example code to reproduce the issue
remove_tag1
will never fail even though it just removesTag1
from every entity,remove_tag12
will crash oneTag1
are removed.The text was updated successfully, but these errors were encountered: