Skip to content

Commit e8855fa

Browse files
committed
only update components for entities in map
1 parent 1398d78 commit e8855fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/bevy_reflect/src/impls/bevy_ecs.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
202202
fn from_type() -> Self {
203203
ReflectMapEntities {
204204
map_entities: |world, entity_map| {
205-
for mut component in &mut world.query_mut::<&mut C>() {
206-
component.map_entities(entity_map)?;
205+
for entity in entity_map.values() {
206+
if let Ok(mut component) = world.get_mut::<C>(entity) {
207+
component.map_entities(entity_map)?;
208+
}
207209
}
208210

209211
Ok(())

0 commit comments

Comments
 (0)