You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call world.flush() after mark_spawn_despawn() (#21397)
# Objective
During despawn, commands are flushed before writing the `despawned_by`
location. This means that commands run by observers will not see the
updated value. It also means an entity spawned by one of those commands
that re-uses the entity index may have its `spawned_by` overwritten by
the `despawned_by` meant for the original entity.
## Solution
Move the call to `world.flush()` after the call to
`mark_spawn_despawn()`.
## Testing
Added a unit test demonstrating the issue.
0 commit comments