Skip to content

Commit

Permalink
Try #2236:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored May 23, 2021
2 parents 653c103 + 05f293b commit 532195a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/bevy_ecs/src/system/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ where
T: Bundle + 'static,
{
fn write(self: Box<Self>, world: &mut World) {
world.entity_mut(self.entity).insert_bundle(self.bundle);
if let Some(mut entity_mut) = world.get_entity_mut(self.entity) {
entity_mut.insert_bundle(self.bundle);
}
}
}

Expand All @@ -353,7 +355,9 @@ where
T: Component,
{
fn write(self: Box<Self>, world: &mut World) {
world.entity_mut(self.entity).insert(self.component);
if let Some(mut entity_mut) = world.get_entity_mut(self.entity) {
entity_mut.insert(self.component);
}
}
}

Expand Down

0 comments on commit 532195a

Please sign in to comment.