diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-01 14:12:24 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-01 14:12:24 +0300 |
| commit | 06df070ba0d7bd2435b8b1313019278090889d09 (patch) | |
| tree | e1e282bccf51fa7a24b42cb4bbab2d8971060820 /apps/fparkan-game/src/main.rs | |
| parent | 85082a1c829050f375ad688d9ed563d753b3727b (diff) | |
| download | fparkan-06df070ba0d7bd2435b8b1313019278090889d09.tar.xz fparkan-06df070ba0d7bd2435b8b1313019278090889d09.zip | |
fix(audio): play flamer sound from the firing node
Feed initial node-attached Op2 rows from the same Control blends as their firing nodes. Keep them separate from projectile one-shots and opcode 10 wind-up sounds. The original Effect.dll confirmed the strict 0.01 threshold. The Constructor replay ordered and boarded the stock warbot, played the heavy flamer before projectile release, and captured the hangar.
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 8ccd06a0..1f128548 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -948,6 +948,7 @@ struct ControlEffectSlot { struct ControlSoundSlot { effect: ControlEffectSlot, waits_for_windup: bool, + follows_weapon_phase: bool, command: Op2SoundCommand, state: Op2SoundState, } @@ -5528,6 +5529,9 @@ fn append_initial_control_effect_slots( .weapon_windup_sound_rows(record) .any(|sound| sound.row_index == row.row_index) }); + let weapon_node_sound = control + .weapon_node_sound_rows() + .any(|sound| sound.row_index == row.row_index); let points = if row.opcode == 4 { let Some(point_list) = point_list else { continue; @@ -5539,7 +5543,7 @@ fn append_initial_control_effect_slots( ) })?) } else { - if !windup && !alarm_controlled && row.point_offsets[0] != 0 { + if !windup && !weapon_node_sound && !alarm_controlled && row.point_offsets[0] != 0 { continue; } None @@ -5570,7 +5574,16 @@ fn append_initial_control_effect_slots( .ok_or_else(|| format!("Control FX {key} was not cached"))?; let header = document.header(); let alarm_effect = alarm_controlled && header.time_mode == 14 && header.flags & 0x40 != 0; - if row.opcode == 3 && !windup && !alarm_effect && !matches!(header.time_mode, 5 | 15) { + let follows_weapon_phase = weapon_node_sound && header.time_mode == 4; + if weapon_node_sound && !follows_weapon_phase && row.point_offsets[0] != 0 { + continue; + } + if row.opcode == 3 + && !windup + && !follows_weapon_phase + && !alarm_effect + && !matches!(header.time_mode, 5 | 15) + { continue; } let sound_commands = document @@ -5696,6 +5709,7 @@ fn append_initial_control_effect_slots( sound_slots.push(ControlSoundSlot { effect: slot, waits_for_windup: windup, + follows_weapon_phase, command: sound, state: Op2SoundState::default(), }); |
