From bf991ad728dd6cdc02168b4d6552f0e7e85181a2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 11:43:57 +0400 Subject: fix(render): drive warbot muzzle flashes with firing phases Use the first CPT node when the effect has no explicit override. Feed the autonomous weapon banks into the same phase sampling path as manual weapons. Confirm the effect constructor and phase reads in the original DLLs, and compare the two cannon flashes in a live AutoDemo window at the same clock sample. --- apps/fparkan-game/src/control_effects.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'apps/fparkan-game') diff --git a/apps/fparkan-game/src/control_effects.rs b/apps/fparkan-game/src/control_effects.rs index 4cee2c16..e3dd50a0 100644 --- a/apps/fparkan-game/src/control_effects.rs +++ b/apps/fparkan-game/src/control_effects.rs @@ -5,8 +5,8 @@ use super::{ }; use fparkan_fx::clock::{FxInstanceClock, FxPhaseProvider}; use fparkan_runtime::{ - control_damage_alarm_active, loaded_mission_assets, loaded_mission_control_device_tables, - AutoDemoCombatEvent, Engine, FiringEffectInstance, + autonomous_firing_effect_phases, control_damage_alarm_active, loaded_mission_assets, + loaded_mission_control_device_tables, AutoDemoCombatEvent, Engine, FiringEffectInstance, }; use std::collections::{HashMap, HashSet}; @@ -78,6 +78,11 @@ impl StaticVulkanApp { }) .into_iter() .flatten() + .chain( + self.mission_engine + .iter() + .flat_map(autonomous_firing_effect_phases), + ) .map(|(effect, phase)| (effect.into(), phase)) .collect(); let mut samples = advance_control_effect_instances( @@ -115,7 +120,7 @@ impl StaticVulkanApp { player_shots, &weapon_phases, ); - // Manual weapon audio is already emitted with the projectile. + // Weapon one-shots are already emitted with the projectile. direct_shot_sounds.extend(self.control_sound_slots.iter().filter_map(|sound| { let key = sound.effect.random_instance_key; (sound.effect.time_mode == 4 && weapon_phases.contains_key(&key)).then_some(key) -- cgit v1.2.3