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.
This commit is contained in:
Ben Frankel 2024-07-15 08:32:20 -07:00 committed by GitHub
parent c3320627ac
commit 18abe2186c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -235,8 +235,7 @@ impl<'w, 's> Commands<'w, 's> {
}
}
/// Pushes a [`Command`] to the queue for creating a new empty [`Entity`],
/// and returns its corresponding [`EntityCommands`].
/// Reserves a new empty [`Entity`] to be spawned, and returns its corresponding [`EntityCommands`].
///
/// See [`World::spawn_empty`] for more details.
///