aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/projectile_parts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/projectile_parts.rs')
-rw-r--r--crates/fparkan-runtime/src/projectile_parts.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/fparkan-runtime/src/projectile_parts.rs b/crates/fparkan-runtime/src/projectile_parts.rs
index eef5422f..d322d5ff 100644
--- a/crates/fparkan-runtime/src/projectile_parts.rs
+++ b/crates/fparkan-runtime/src/projectile_parts.rs
@@ -4,8 +4,8 @@ use crate::{
projectile::{segment_sphere_fraction, ProjectileNode},
turret_aim::hull_local_point,
weapon_pose::WeaponPoses,
- Engine, LoadedMissionState, MissionAssets, MissionControlNodeProviderTableStatus, ObjectHandle,
- TransformState,
+ Engine, LoadedMissionState, MissionAssets, MissionControlNodeProviderRow,
+ MissionControlNodeProviderTableStatus, ObjectHandle, TransformState,
};
use fparkan_animation::NodePoseBuffer;
use fparkan_assets::PreparedModel;
@@ -45,12 +45,16 @@ pub fn depleted_warbot_nodes(engine: &Engine) -> impl Iterator<Item = (usize, us
.flat_map(|(index, rows)| {
rows.iter()
.skip(1)
- .filter(|row| row.current_flags.is_some_and(|flags| flags & 0x12 == 0x10))
+ .filter(|row| warbot_node_is_depleted(row))
.map(move |row| (index, row.unit_component_index, row.source_row_index))
})
})
}
+pub(super) fn warbot_node_is_depleted(row: &MissionControlNodeProviderRow) -> bool {
+ row.current_flags.is_some_and(|flags| flags & 0x12 == 0x10)
+}
+
pub(super) fn chassis_part_contact(
mission: &LoadedMissionState,
index: usize,