Skip to content

Commit

Permalink
only update components for entities in map
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Dec 7, 2020
1 parent 1398d78 commit e8855fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_reflect/src/impls/bevy_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
fn from_type() -> Self {
ReflectMapEntities {
map_entities: |world, entity_map| {
for mut component in &mut world.query_mut::<&mut C>() {
component.map_entities(entity_map)?;
for entity in entity_map.values() {
if let Ok(mut component) = world.get_mut::<C>(entity) {
component.map_entities(entity_map)?;
}
}

Ok(())
Expand Down

0 comments on commit e8855fa

Please sign in to comment.