From 2e0a4571af587f28ba5ea580f177a225d0d352e2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 20:09:41 +0400 Subject: 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. --- apps/fparkan-game/src/shot_sound.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/fparkan-game/src/shot_sound.rs') 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:?}"); }; -- cgit v1.2.3