Skip to content

Commit c7ad98a

Browse files
alice-i-cecilecart
authored andcommitted
Remove warning about missed events due to false positives (#6730)
# Objective - Reverts #5730. - Fixes #6173, fixes #6596. ## Solution Remove the warning entirely. ## Changelog You will no longer be spammed about > Missed 31 `bevy_input::mouse::MouseMotion` events. Consider reading from the `EventReader` more often (generally the best solution) or calling Events::update() less frequently (normally this is called once per frame). This problem is most likely due to run criteria/fixed timesteps or consuming events conditionally. See the Events documentation for more information. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
1 parent 7c17f3f commit c7ad98a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

crates/bevy_ecs/src/event.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate as bevy_ecs;
44
use crate::system::{Local, Res, ResMut, Resource, SystemParam};
5-
use bevy_utils::tracing::{trace, warn};
5+
use bevy_utils::tracing::trace;
66
use std::ops::{Deref, DerefMut};
77
use std::{fmt, hash::Hash, marker::PhantomData};
88

@@ -352,15 +352,6 @@ impl<E: Event> ManualEventReader<E> {
352352
events: &'a Events<E>,
353353
) -> impl DoubleEndedIterator<Item = (&'a E, EventId<E>)>
354354
+ ExactSizeIterator<Item = (&'a E, EventId<E>)> {
355-
// if the reader has seen some of the events in a buffer, find the proper index offset.
356-
// otherwise read all events in the buffer
357-
let missed = self.missed_events(events);
358-
if missed > 0 {
359-
let plural = if missed == 1 { "event" } else { "events" };
360-
let type_name = std::any::type_name::<E>();
361-
warn!("Missed {missed} `{type_name}` {plural}. Consider reading from the `EventReader` more often (generally the best solution) or calling Events::update() less frequently (normally this is called once per frame). This problem is most likely due to run criteria/fixed timesteps or consuming events conditionally. See the Events documentation for more information.");
362-
}
363-
364355
let a_index = (self.last_event_count).saturating_sub(events.events_a.start_event_count);
365356
let b_index = (self.last_event_count).saturating_sub(events.events_b.start_event_count);
366357
let a = events.events_a.get(a_index..).unwrap_or_default();

0 commit comments

Comments
 (0)