diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 06:10:46 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 06:10:46 +0300 |
| commit | 8f1ba615bf1e393698eae7624073c1ad9f54c02b (patch) | |
| tree | 2f3792c5070d4253472ee24d45d2d3dad3813e76 /crates/fparkan-runtime/src/unit_combat.rs | |
| parent | 3dd13b710e1e559ef3f5cf15f3c6b50e8377d161 (diff) | |
| download | fparkan-8f1ba615bf1e393698eae7624073c1ad9f54c02b.tar.xz fparkan-8f1ba615bf1e393698eae7624073c1ad9f54c02b.zip | |
feat(combat): play the referenced explosion on chassis destruction
Read the version-one EXPL reference from the depleted NDP root. Retain the death position across slot reuse and show the authored billboard, light and sound after the mesh is removed.
Verified the explosion sprite after a stock AutoDemo kill, with Vulkan validation clean. Node detachment, debris particles and building destruction remain open.
Diffstat (limited to 'crates/fparkan-runtime/src/unit_combat.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_combat.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/unit_combat.rs b/crates/fparkan-runtime/src/unit_combat.rs index 777aee89..f1e86aab 100644 --- a/crates/fparkan-runtime/src/unit_combat.rs +++ b/crates/fparkan-runtime/src/unit_combat.rs @@ -720,9 +720,12 @@ mod tests { let mut observed_aimed_turret = false; let mut observed_finished_segment = false; let mut observed_weapon_effect = false; + crate::collect_unit_destruction_effects(&mut engine); let mut observed_unavailable = engine.autodemo_combat.as_ref().unwrap().unavailable as u64; for now in (0..=120_000).step_by(50) { let frame = frame(&mut engine, now).unwrap(); + let destruction_effects = crate::take_unit_destruction_effects(&mut engine); + assert!(crate::take_unit_destruction_effects(&mut engine).is_empty()); observed_unavailable += frame.autodemo_combat_unavailable as u64; let shots = frame .autodemo_combat_events @@ -822,6 +825,14 @@ mod tests { .iter() .find(|event| matches!(event, AutoDemoCombatEvent::Destroyed { .. })) { + assert!(destruction_effects.iter().any(|event| { + event.archive == "system.rlb" + && event.name == "explode_rbr_b.exp" + && event + .position + .iter() + .all(|coordinate| coordinate.is_finite()) + })); assert!(identity_metadata(&engine.world, *target).is_err()); let ((_, retired), total) = combat .report |
