Skip to content

Commit 18abe21

Browse files
authored
Fix inaccurate docs for Commands::spawn_empty (#14234)
# Objective `Commands::spawn_empty` docs say that it queues a command to spawn an entity, but it doesn't. It immediately reserves an `Entity` to be spawned at the next flush point, which is possible because `Entities::reserve_entity()` takes `&self` and no components are added yet. ## Solution Fix docs.
1 parent c332062 commit 18abe21

File tree

1 file changed

+1
-2
lines changed
  • crates/bevy_ecs/src/system/commands

1 file changed

+1
-2
lines changed

crates/bevy_ecs/src/system/commands/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ impl<'w, 's> Commands<'w, 's> {
235235
}
236236
}
237237

238-
/// Pushes a [`Command`] to the queue for creating a new empty [`Entity`],
239-
/// and returns its corresponding [`EntityCommands`].
238+
/// Reserves a new empty [`Entity`] to be spawned, and returns its corresponding [`EntityCommands`].
240239
///
241240
/// See [`World::spawn_empty`] for more details.
242241
///

0 commit comments

Comments
 (0)