diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 06:47:56 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 06:47:56 +0300 |
| commit | c6888a10b8f0512c9b978dd03f0a347b3cac1c0e (patch) | |
| tree | 0eb9301907e19a7eff8da7f962932190891550c8 /apps/fparkan-game/src/audio.rs | |
| parent | 9b689e52f59b55ca89307c7b3d10e770c715e565 (diff) | |
| download | fparkan-c6888a10b8f0512c9b978dd03f0a347b3cac1c0e.tar.xz fparkan-c6888a10b8f0512c9b978dd03f0a347b3cac1c0e.zip | |
feat(game): damage and remove units hit by player projectiles
Diffstat (limited to 'apps/fparkan-game/src/audio.rs')
| -rw-r--r-- | apps/fparkan-game/src/audio.rs | 12 |
1 files changed, 8 insertions, 4 deletions
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) |
