Skip to content

Commit

Permalink
only update components for entities in map (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf authored Dec 9, 2020
1 parent 19c4f33 commit c54179b
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 c54179b

Please sign in to comment.