From 0fade3cf1100f9122d104f69d9cce2efc6306279 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 10:01:44 +0400 Subject: feat(factory): release assembled warbots above the roof Find the factory roof with a vertical ray, apply the native height offsets, and keep the departure task active through descent and apron clearance. Verify both stock Two Fortresses factories and transport delivery, and check the descent in a fixed-camera Vulkan run. --- crates/fparkan-runtime/src/unit_patrol.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/unit_patrol.rs') diff --git a/crates/fparkan-runtime/src/unit_patrol.rs b/crates/fparkan-runtime/src/unit_patrol.rs index 8050caac..e73c2404 100644 --- a/crates/fparkan-runtime/src/unit_patrol.rs +++ b/crates/fparkan-runtime/src/unit_patrol.rs @@ -319,6 +319,12 @@ impl UnitPatrol { .any(|departure| departure.handle == unit) } + pub(super) fn has_factory_departure(&self, plant: ObjectHandle) -> bool { + self.factory_departures + .iter() + .any(|departure| departure.plant == plant) + } + pub(super) fn is_moving_to_destination(&self, handle: ObjectHandle) -> bool { self.units .iter() @@ -461,7 +467,7 @@ impl UnitPatrol { }; let mut poses = Vec::new(); if seconds > 0.0 { - for departure in std::mem::take(&mut state.factory_departures) { + for mut departure in std::mem::take(&mut state.factory_departures) { let handle = departure.handle; let Ok(before) = transform_state(world, handle) else { continue; -- cgit v1.2.3