aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-01 06:57:23 +0300
committerValentin Popov <valentin@popov.link>2026-12-01 06:57:23 +0300
commit31dd73cbf59f5c8fe58b77b373a75033dc5a037a (patch)
tree7a20ada1d75679b61a6c6716ffe91a10faba4592 /crates/fparkan-runtime/src/lib.rs
parent364f8a0984e5cd3b65e81f24e95fcf8cd92aec2d (diff)
downloadfparkan-31dd73cbf59f5c8fe58b77b373a75033dc5a037a.tar.xz
fparkan-31dd73cbf59f5c8fe58b77b373a75033dc5a037a.zip
fix(fx): switch warbot smoke with the damage alarm
Resolve the matching enable and disable selectors from authored CTL alarm groups. Render node-attached smoke and light only while the live Control alarm is active. Verify the native selector against both DLLs and inspect two Vulkan frames around an ordinary AutoDemo alarm. Independent mode-14 triggers and the damage stage cascade remain open.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 3b097acd..e6fe77af 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -3875,6 +3875,16 @@ pub fn loaded_mission_control_device_tables(
.map(|state| state.control_device_tables.as_slice())
}
+/// Whether Control has switched this live object into its damage alarm.
+#[must_use]
+pub fn control_damage_alarm_active(engine: &Engine, handle: ObjectHandle) -> bool {
+ transform_state(&engine.world, handle).is_ok()
+ && engine
+ .loaded
+ .as_ref()
+ .is_some_and(|mission| mission.control_resources.alarm_active(handle))
+}
+
/// Returns the initial prepared Control grouping for full-load mission objects.
#[must_use]
pub fn loaded_mission_behavior_control_groupings(
@@ -8606,6 +8616,7 @@ mod tests {
node_data: None,
effect_section: PreparedControlEffectSection::Parsed(rows),
initial_effect_group,
+ alarm_effect_rows: Vec::new(),
node_effect_links: Vec::new(),
effect_modes: Vec::new(),
point_list: point_count.map(|count| PreparedControlPointList {
@@ -9112,6 +9123,7 @@ mod tests {
node_data: None,
effect_section,
initial_effect_group: None,
+ alarm_effect_rows: Vec::new(),
node_effect_links: Vec::new(),
effect_modes: Vec::new(),
point_list: None,