From c6888a10b8f0512c9b978dd03f0a347b3cac1c0e Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 07:47:56 +0400 Subject: feat(game): damage and remove units hit by player projectiles --- apps/fparkan-game/src/audio.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps/fparkan-game/src/audio.rs') diff --git a/apps/fparkan-game/src/audio.rs b/apps/fparkan-game/src/audio.rs index 80cf97f9..0d83f054 100644 --- a/apps/fparkan-game/src/audio.rs +++ b/apps/fparkan-game/src/audio.rs @@ -890,15 +890,19 @@ impl GameAudio { } } SoundAction::StopLoop => { - if let Some(player) = self.control_sounds.remove(&id) { - player.stop(); - eprintln!("control_sound_stop id={id}"); - } + self.stop_control_sound(id); } } Ok(()) } + pub(crate) fn stop_control_sound(&mut self, id: usize) { + if let Some(player) = self.control_sounds.remove(&id) { + player.stop(); + eprintln!("control_sound_stop id={id}"); + } + } + pub(crate) fn control_sound_is_playing(&self, id: usize) -> bool { self.control_sounds .get(&id) -- cgit v1.2.3