bevy/crates/bevy_ecs/src
Eagster b1c1aac1b3 Ensure spawning related entities in an OnAdd observer downstream of a World::spawn in a Command does not cause a crash (#18545)
# Objective

fixes #18452.

## Solution

Spawning used to flush commands only, but those commands can reserve
entities. Now, spawning flushes everything, including reserved entities.
I checked, and this was the only place where `flush_commands` is used
instead of `flush` by mistake.

## Testing

I simplified the MRE from #18452 into its own test, which fails on main,
but passes on this branch.
2025-03-25 22:59:05 +01:00
..
entity Replace VisitEntities with MapEntities (#18432) 2025-03-24 00:09:29 +01:00
error Make system param validation rely on the unified ECS error handling via the GLOBAL_ERROR_HANDLER (#18454) 2025-03-25 22:59:01 +01:00
event bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
identifier bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
observer Ensure spawning related entities in an OnAdd observer downstream of a World::spawn in a Command does not cause a crash (#18545) 2025-03-25 22:59:05 +01:00
query implement get_many_unique (#18315) 2025-03-16 21:12:26 +00:00
reflect Replace VisitEntities with MapEntities (#18432) 2025-03-24 00:09:29 +01:00
relationship Replace VisitEntities with MapEntities (#18432) 2025-03-24 00:09:29 +01:00
schedule Define system param validation on a per-system parameter basis (#18504) 2025-03-25 22:59:04 +01:00
storage Queued component registration (#18173) 2025-03-10 21:46:27 +00:00
system Define system param validation on a per-system parameter basis (#18504) 2025-03-25 22:59:04 +01:00
world Ensure spawning related entities in an OnAdd observer downstream of a World::spawn in a Command does not cause a crash (#18545) 2025-03-25 22:59:05 +01:00
archetype.rs Fix clippy::let_and_return in bevy_ecs (#18481) 2025-03-24 00:09:30 +01:00
batching.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
bundle.rs Fix clippy::let_and_return in bevy_ecs (#18481) 2025-03-24 00:09:30 +01:00
change_detection.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
component.rs Replace VisitEntities with MapEntities (#18432) 2025-03-24 00:09:29 +01:00
entity_disabling.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
hierarchy.rs Regression fix: Reintroduce sorting/reordering methods on Children (#18476) 2025-03-24 00:14:22 +01:00
intern.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
label.rs do_not_recommend interned Labels (#17950) 2025-02-25 23:46:21 +00:00
lib.rs Make system param validation rely on the unified ECS error handling via the GLOBAL_ERROR_HANDLER (#18454) 2025-03-25 22:59:01 +01:00
name.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
removal_detection.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
resource.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
spawn.rs Implement SpawnableList for Vec<Bundle> (#18259) 2025-03-11 20:32:37 +00:00
traversal.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00