We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1398d78 commit e8855faCopy full SHA for e8855fa
crates/bevy_reflect/src/impls/bevy_ecs.rs
@@ -202,8 +202,10 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
202
fn from_type() -> Self {
203
ReflectMapEntities {
204
map_entities: |world, entity_map| {
205
- for mut component in &mut world.query_mut::<&mut C>() {
206
- component.map_entities(entity_map)?;
+ for entity in entity_map.values() {
+ if let Ok(mut component) = world.get_mut::<C>(entity) {
207
+ component.map_entities(entity_map)?;
208
+ }
209
}
210
211
Ok(())
0 commit comments