From ce4fdc768602efe7c621e631c1390d8d76248505 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 09:24:02 +0400 Subject: feat(combat): apply projectile hits to chassis nodes Use prepared chassis triangles to choose a loaded NDP node. Exhausted ordinary parts play their authored EXPL independently of root death. Unresolved mounted geometry keeps a sphere contact on exit. A stock side-shot fixture exhausts a heavy chassis part while the hull survives. --- crates/fparkan-runtime/src/destruction.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/fparkan-runtime/src/destruction.rs') diff --git a/crates/fparkan-runtime/src/destruction.rs b/crates/fparkan-runtime/src/destruction.rs index 50f307fa..8fb3a1bf 100644 --- a/crates/fparkan-runtime/src/destruction.rs +++ b/crates/fparkan-runtime/src/destruction.rs @@ -32,7 +32,7 @@ pub fn take_unit_destruction_effects(engine: &mut Engine) -> Vec impl Iterator + '_ { @@ -54,6 +54,8 @@ pub fn unit_destruction_effect_sources( }; Some(if class & UNIT_DAT_CONTROL_CLASS_HIGH_BIT != 0 { rows.as_slice() + } else if class == super::boarding::WARBOT_CLASS { + &rows[..rows.partition_point(|row| row.unit_component_index == 0)] } else if class & MOBILE_UNIT != 0 { rows.get(..1).unwrap_or_default() } else { @@ -64,7 +66,7 @@ pub fn unit_destruction_effect_sources( }) } -pub(super) fn building_part_effect( +pub(super) fn part_effect( row: &MissionControlNodeProviderRow, position: [f32; 3], ) -> Option { -- cgit v1.2.3