From e8668e26394c480f16643cc584439c3a6041fe29 Mon Sep 17 00:00:00 2001 From: NathanSWard Date: Sun, 20 Jun 2021 15:33:47 -0600 Subject: [PATCH] remember to flush world --- crates/bevy_ecs/src/system/commands/command_queue.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/bevy_ecs/src/system/commands/command_queue.rs b/crates/bevy_ecs/src/system/commands/command_queue.rs index bfc846347cb788..4880684f7b7d95 100644 --- a/crates/bevy_ecs/src/system/commands/command_queue.rs +++ b/crates/bevy_ecs/src/system/commands/command_queue.rs @@ -73,6 +73,9 @@ impl CommandQueue { /// This clears the queue. #[inline] pub fn apply(&mut self, world: &mut World) { + // flush previouly queued entities + world.flush(); + // SAFE: In the iteration below, `meta.func` will safely consume and drop each pushed command. // This operation is so that we can reuse the bytes `Vec`'s internal storage and prevent // unnecessary allocations.