bevy/crates/bevy_ecs/src
TheBigCheese dd92a7705d
Small addition to World::flush_commands explaining how spawn will cause it to panic. (#15411)
# Objective
`World::flush_commands` will cause a panic with `error[B0003]: Could not
insert a bundle [...] for entity [...] because it doesn't exist in this
World` if there was a `spawn` command in the queue and you should
instead use `flush` for this but this isn't mentioned in the docs

## Solution
Add a note to the docs suggesting to use `World::flush` in this context.
This error doesn't appear to happen with `spawn_batch` so I didn't add
that to the note although you can cause it with
`commands.spawn_empty().insert(...)` but I wasn't sure that was worth
the documentation complexity as it is pretty unlikely (and equivalent to
`commands.spawn(...)`.
2024-09-30 17:23:52 +00:00
..
entity Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
event Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
identifier Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
observer System param validation for observers, system registry and run once (#15526) 2024-09-30 01:00:39 +00:00
query Reduce memory usage in component fetches and change detection filters (#15283) 2024-09-27 14:06:40 +00:00
reflect Allow registering of resources via ReflectResource / ReflectComponent (#15496) 2024-09-28 20:49:53 +00:00
schedule Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
storage Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
system Reorganize SystemParamBuilder docs and examples. (#15102) 2024-09-30 16:59:52 +00:00
world Small addition to World::flush_commands explaining how spawn will cause it to panic. (#15411) 2024-09-30 17:23:52 +00:00
archetype.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
batching.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
bundle.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
change_detection.rs QuerySingle family of system params (#15476) 2024-09-28 19:35:27 +00:00
component.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
intern.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
label.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
lib.rs rename QuerySingle to Single (#15507) 2024-09-29 03:26:28 +00:00
removal_detection.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
traversal.rs Bubbling observers traversal should use query data (#15385) 2024-09-23 18:08:36 +00:00