From 204223a2b3900f3be981942ecde81ec7475f440c Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 06:53:50 +0400 Subject: fix(combat): load CPT launch points for rocket racks Read the component's authored CPT when its weapon records reference firing rows. The stock medium and heavy racks have no muzzle flash row, but their 16 and 9 launch points belong to the weapon cycle. The licensed battery test verifies both rack layouts. A runtime replay from the stock Two Fortresses start records heavy rocket launches from the restored racks. All 29 stock missions reach 900 simulation seconds. --- crates/fparkan-runtime/src/player_weapon.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src') diff --git a/crates/fparkan-runtime/src/player_weapon.rs b/crates/fparkan-runtime/src/player_weapon.rs index b966af9a..db24036b 100644 --- a/crates/fparkan-runtime/src/player_weapon.rs +++ b/crates/fparkan-runtime/src/player_weapon.rs @@ -552,7 +552,7 @@ mod tests { #[test] #[ignore = "requires licensed corpus"] - fn licensed_medium_warbot_prepares_its_cannon_from_the_cpt_node() { + fn licensed_fortress_warbots_prepare_their_authored_cpt_weapons() { use crate::{ create, load_gameplay_mission, EngineServices, MissionMode, MissionRequest, MissionStartupInput, @@ -588,6 +588,25 @@ mod tests { (point.raw_signed_field_04, point.raw_signed_field_08), (3, 2) ); + + for (index, projectile, tube_count) in [(12, "br_l_01", 16), (14, "br_b_01", 9)] { + let (_, bank) = prepared_warbot_weapons(&engine) + .find(|(unit, _)| *unit == index) + .expect("warbot with rocket racks"); + let racks: Vec<_> = bank + .weapons() + .iter() + .filter(|weapon| weapon.projectile == projectile) + .collect(); + assert_eq!(racks.len(), 2, "warbot {index}"); + for rack in racks { + assert_eq!(rack.barrels.len(), tube_count); + assert_eq!(rack.rounds_remaining(), Some(tube_count as u32)); + assert!(rack.barrels.iter().enumerate().all(|(i, tube)| { + tube.row.raw_parameters[1] == i as u32 && tube.muzzle.raw_signed_field_04 == 1 + })); + } + } } #[test] -- cgit v1.2.3