diff --git a/src/game/systems/control.rs b/src/game/systems/control.rs index 76b256b..ae0c809 100644 --- a/src/game/systems/control.rs +++ b/src/game/systems/control.rs @@ -440,15 +440,17 @@ pub fn eat( if *antidote_pos == head_pos.to_position() { commands.entity(ent).despawn(); + if head.immunity.finished() { + commands.spawn(( + AudioPlayer(sounds.antidote.clone()), + PlaybackSettings::LOOP, + AntidoteSound, + OnGameScreen, + )); + } + let remaining = head.immunity.remaining_secs(); head.immunity = Timer::from_seconds(10.0 + remaining, TimerMode::Once); - - commands.spawn(( - AudioPlayer(sounds.antidote.clone()), - PlaybackSettings::LOOP, - AntidoteSound, - OnGameScreen, - )); } }