aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src')
-rw-r--r--crates/fparkan-runtime/src/cockpit_instruments.rs3
-rw-r--r--crates/fparkan-runtime/src/projectile.rs5
2 files changed, 7 insertions, 1 deletions
diff --git a/crates/fparkan-runtime/src/cockpit_instruments.rs b/crates/fparkan-runtime/src/cockpit_instruments.rs
index 9911d52e..4948773e 100644
--- a/crates/fparkan-runtime/src/cockpit_instruments.rs
+++ b/crates/fparkan-runtime/src/cockpit_instruments.rs
@@ -91,7 +91,8 @@ pub fn instrument_readout(
})
}
-/// Local sphere used by AniMesh selector 2 with the targeter's node filter.
+/// Initial local sphere used by AniMesh selector 2 with the targeter's node
+/// filter. Changing a node's damage stage does not invalidate this sphere.
pub fn instrument_bounds(engine: &Engine, object_index: usize) -> Option<([f32; 3], f32)> {
let mission = engine.loaded.as_ref()?;
let draft = mission.object_drafts.get(object_index)?;
diff --git a/crates/fparkan-runtime/src/projectile.rs b/crates/fparkan-runtime/src/projectile.rs
index 66cdbc8b..dd3a857d 100644
--- a/crates/fparkan-runtime/src/projectile.rs
+++ b/crates/fparkan-runtime/src/projectile.rs
@@ -738,6 +738,7 @@ mod tests {
)
.unwrap();
let plant = handle_by_original_id(&engine.world, OriginalObjectId(5)).unwrap();
+ let intact_bounds = crate::cockpit_instruments::instrument_bounds(&engine, 5).unwrap();
let table = engine
.loaded
.as_mut()
@@ -795,6 +796,10 @@ mod tests {
.any(|state| state == ((0, 1), Some(1)))
);
assert_eq!(
+ crate::cockpit_instruments::instrument_bounds(&engine, 5),
+ Some(intact_bounds)
+ );
+ assert_eq!(
crate::control_node_provider_row(table, 3)
.unwrap()
.mesh_state