diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 09:01:44 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 09:01:44 +0300 |
| commit | 0fade3cf1100f9122d104f69d9cce2efc6306279 (patch) | |
| tree | a67ff5dc54f686211b48f739f92af8a79e33e699 /crates/fparkan-runtime/src/unit_patrol.rs | |
| parent | 2f75b9792c98c4d32b0349810080dd226357b505 (diff) | |
| download | fparkan-0fade3cf1100f9122d104f69d9cce2efc6306279.tar.xz fparkan-0fade3cf1100f9122d104f69d9cce2efc6306279.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/unit_patrol.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_patrol.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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; |
