aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/shot_sound.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 19:09:41 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 19:09:41 +0300
commit2e0a4571af587f28ba5ea580f177a225d0d352e2 (patch)
treeaf456896c423edd6bc8b45666e64f46689cd7bcf /apps/fparkan-game/src/shot_sound.rs
parent4367287f9e07aca6a173a5eaef641a75918d66e0 (diff)
downloadfparkan-2e0a4571af587f28ba5ea580f177a225d0d352e2.tar.xz
fparkan-2e0a4571af587f28ba5ea580f177a225d0d352e2.zip
fix(audio): attach the engine loop to the player's missile
Prepare velocity-driven Op2 sounds with the projectile's CTL attachment. Move their source with the active flight and stop it when the flight ends or its slot is reused. Keep launch as a separate one-shot. The GOG phase function confirms the missile's 0 to 1 phase range. In the stock Firing Line window the engine loop began at the tail and stopped on terrain contact.
Diffstat (limited to 'apps/fparkan-game/src/shot_sound.rs')
-rw-r--r--apps/fparkan-game/src/shot_sound.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/fparkan-game/src/shot_sound.rs b/apps/fparkan-game/src/shot_sound.rs
index 02c561ee..a477e415 100644
--- a/apps/fparkan-game/src/shot_sound.rs
+++ b/apps/fparkan-game/src/shot_sound.rs
@@ -109,7 +109,7 @@ mod tests {
let engine = create(EngineServices::new(Arc::new(DirectoryVfs::new(&root)))).unwrap();
let missile = load_player_projectile(&engine, "objects.rlb", "bm_h_01").unwrap();
let effects = crate::projectile_render::initial_effects(&root, &missile, "bm_h_01");
- let sounds = projectile_launch(effects.iter().map(|(_, effect)| effect));
+ let sounds = projectile_launch(effects.iter().map(|effect| &effect.document));
let [sound] = sounds.as_slice() else {
panic!("expected the single launch sound, got {sounds:?}");
};