aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-01 05:53:50 +0300
committerValentin Popov <valentin@popov.link>2026-12-01 05:53:50 +0300
commit204223a2b3900f3be981942ecde81ec7475f440c (patch)
tree3801cae210fa1d5579571f25d56497ac53e27af2 /crates/fparkan-assets/src/lib.rs
parent7361569a4f2f05ba4c97f276478e70b98c7da39a (diff)
downloadfparkan-204223a2b3900f3be981942ecde81ec7475f440c.tar.xz
fparkan-204223a2b3900f3be981942ecde81ec7475f440c.zip
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.
Diffstat (limited to 'crates/fparkan-assets/src/lib.rs')
-rw-r--r--crates/fparkan-assets/src/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/fparkan-assets/src/lib.rs b/crates/fparkan-assets/src/lib.rs
index 51270eca..d98bff3d 100644
--- a/crates/fparkan-assets/src/lib.rs
+++ b/crates/fparkan-assets/src/lib.rs
@@ -1059,7 +1059,7 @@ pub struct PreparedComponentControl {
pub node_effect_links: Vec<(usize, u32, u32)>,
/// Changes to the clocks of existing effect instances, from opcode 10.
pub effect_modes: Vec<PreparedControlEffectMode>,
- /// Component-local points selected for parsed effect rows, when present.
+ /// Component-local points used by weapons and effect rows, when present.
pub point_list: Option<PreparedControlPointList>,
}
@@ -3668,7 +3668,11 @@ fn prepare_component_control_from_resource<R: ResourceRepository>(
&control.effect_section,
PreparedControlEffectSection::Parsed(rows) if rows.iter().any(|row| row.opcode == 4)
);
- let Some(point_source) = point_source.filter(|_| has_effect_rows) else {
+ let has_weapon_points = control
+ .typed_records
+ .iter()
+ .any(|record| record.tag == 2 && !record.values.is_empty());
+ let Some(point_source) = point_source.filter(|_| has_effect_rows || has_weapon_points) else {
return Ok(Some(control));
};
let Some(point_payload) =