From 5a2aa6ff6b6f4ab2480eed5be90957377d00c9e2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 06:40:09 +0400 Subject: feat(combat): play spatial sounds for autonomous weapon shots Carry the firing effect and muzzle position on the shot event. Resolve single-gun effects by their matching muzzle point when there is no node link. Play each one-shot as its simulation frame arrives. Verified a stock gun sound enqueues a spatial voice with the flight starting position. AutoDemo ran with Vulkan validation clean and no playback errors. Comparison by ear with the original remains open. --- crates/fparkan-runtime/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/fparkan-runtime/src/lib.rs') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 53a41112..71afd080 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -3354,6 +3354,14 @@ pub fn autodemo_projectile_types(engine: &Engine) -> &[AutoDemoProjectileType] { .map_or(&[], unit_combat::AutoDemoCombat::types) } +/// Asset sources referenced by autonomous weapon firing events. +pub fn autonomous_weapon_effects(engine: &Engine) -> &[(String, String)] { + engine + .autodemo_combat + .as_ref() + .map_or(&[], unit_combat::AutoDemoCombat::weapon_effects) +} + /// Active autonomous flights in the current world. pub fn autodemo_projectiles( engine: &Engine, @@ -16576,6 +16584,7 @@ mod tests { shooter, target, projectile, + .. } => { assert_ne!(shooter, target); assert!(projectile < autodemo_projectile_types(&engine).len()); -- cgit v1.2.3