diff options
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 12 |
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, |
