From 4367287f9e07aca6a173a5eaef641a75918d66e0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 20:02:16 +0400 Subject: fix(audio): start node-attached laser sounds during wind-up Use the weapon descriptor's Control group to select the mode-1 sound rows. Update them through the existing FX clock and spatial Op2 playback for both manual and autonomous weapons. The GOG Control/Effect entry points confirm the selector, epoch and phase threshold, including retriggering after a sample at the exact phase peak. The stock Two Fortresses helicopter started the original sound at both weapon nodes in a Vulkan window. --- apps/fparkan-game/src/shot_sound.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 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 893b3a14..02c561ee 100644 --- a/apps/fparkan-game/src/shot_sound.rs +++ b/apps/fparkan-game/src/shot_sound.rs @@ -32,6 +32,7 @@ pub(super) fn projectile_launch<'a>( pub(super) fn report_missing_player_sounds( layouts: &std::collections::HashMap, projectiles: &[Option], + control_sounds: &[super::ControlSoundSlot], ) { for (&object, layout) in layouts { for (weapon, (pool, sound)) in layout.weapons.weapons().iter().zip(&layout.slots) { @@ -39,7 +40,13 @@ pub(super) fn report_missing_player_sounds( .get(*pool) .and_then(Option::as_ref) .is_some_and(|draw| !draw.launch_sounds.is_empty()); - if sound.is_none() && !has_launch_sound { + let has_windup_sound = weapon.windup_sounds(object).any(|effect| { + let key = super::ControlEffectInstanceKey::from(effect); + control_sounds + .iter() + .any(|slot| slot.effect.random_instance_key == key) + }); + if sound.is_none() && !has_launch_sound && !has_windup_sound { eprintln!( "sim_coverage player_weapon_sound_stub=1 object={object} projectile={}", weapon.projectile -- cgit v1.2.3