This commit is contained in:
2025-09-25 00:07:53 -04:00
parent 57bfd2d348
commit 8829878f2e

View File

@@ -244,6 +244,7 @@ impl<Ctx: 'static> Event<Ctx> for Senses {
impl<Ctx: 'static> EventModule<Ctx, Senses> for SensorModule<Ctx> { impl<Ctx: 'static> EventModule<Ctx, Senses> for SensorModule<Ctx> {
fn register(&mut self, id: Id, senses: Senses, f: impl EventFn<Ctx, SenseData>) { fn register(&mut self, id: Id, senses: Senses, f: impl EventFn<Ctx, SenseData>) {
// TODO: does not add to active if currently active
self.map.entry(id).or_default().sensors.push(Sensor { self.map.entry(id).or_default().sensors.push(Sensor {
senses, senses,
f: Box::new(f), f: Box::new(f),
@@ -258,11 +259,7 @@ impl<Ctx: 'static> Event<Ctx> for Sense {
impl<Ctx: 'static> EventModule<Ctx, Sense> for SensorModule<Ctx> { impl<Ctx: 'static> EventModule<Ctx, Sense> for SensorModule<Ctx> {
fn register(&mut self, id: Id, sense: Sense, f: impl EventFn<Ctx, SenseData>) { fn register(&mut self, id: Id, sense: Sense, f: impl EventFn<Ctx, SenseData>) {
// TODO: does not add to active if currently active self.register(id, Senses::from(sense), f);
self.map.entry(id).or_default().sensors.push(Sensor {
senses: sense.into(),
f: Box::new(f),
});
} }
} }