bevy/crates/bevy_ecs/src
Doug Roeper c859eacdc8
Fix bug where events are not being dropped (#11528)
# Objective

Fix an issue where events are not being dropped after being read. I
believe #10077 introduced this issue. The code currently works as
follows:

1. `EventUpdateSignal` is **shared for all event types**
2. During the fixed update phase, `EventUpdateSignal` is set to true
3. `event_update_system`, **unique per event type**, runs to update
Events<T>
4. `event_update_system` reads value of `EventUpdateSignal` to check if
it should update, and then **resets** the value to false

If there are multiple event types, the first `event_update_system` run
will reset the shared `EventUpdateSignal` signal, preventing other
events from being cleared.

## Solution

I've updated the code to have separate signals per event type and added
a shared signal to notify all systems that the time plugin is installed.

## Changelog

- Fixed bug where events were not being dropped
2024-02-02 21:14:54 +00:00
..
entity Add a doctest example for EntityMapper (#11583) 2024-01-29 16:56:44 +00:00
identifier Unified identifer for entities & relations (#9797) 2024-01-13 01:09:32 +00:00
query bevy_ecs: Add doc example for par_iter_mut (#11311) (#11499) 2024-01-28 02:13:03 +00:00
reflect Make the MapEntities trait generic over Mappers, and add a simpler EntityMapper (#11428) 2024-01-28 19:51:46 +00:00
schedule Rename Schedule::name to Schedule::label (#11531) 2024-01-25 19:13:23 +00:00
storage Double the capacity when BlobVec is full (#11167) 2024-01-22 15:05:34 +00:00
system bevy_ecs: Add doc example for par_iter_mut (#11311) (#11499) 2024-01-28 02:13:03 +00:00
world added ability to get Res<T> from World with World::get_resource_ref (#11561) 2024-01-28 01:38:21 +00:00
archetype.rs Rename ArchetypeEntity::entity into ArchetypeEntity::id (#11118) 2024-01-01 16:12:24 +00:00
bundle.rs Allow #[derive(Bundle)] on tuple structs (take 3) (#10561) 2023-11-21 01:09:16 +00:00
change_detection.rs Simplify conditions (#11316) 2024-01-13 13:22:17 +00:00
component.rs Adding derive Reflect for tick structs (#11641) 2024-02-01 16:11:32 +00:00
event.rs Fix bug where events are not being dropped (#11528) 2024-02-02 21:14:54 +00:00
lib.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
removal_detection.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00