From dfbdef7d4d1d295ee962dd8aab754ce6be902f8d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 12:16:16 +0400 Subject: fix(ai): follow capture passages through building doors A stock Two Fortresses run now takes the generator after the capturer descends its authored hallway. Symmetric Res17 door links drive the CTLD animation and unsupported routes retain explicit coverage. Checked the approach and descent in the game window with Vulkan validation and verified the owner transfer in a licensed test. --- crates/fparkan-runtime/src/clan_ai_events.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/clan_ai_events.rs') diff --git a/crates/fparkan-runtime/src/clan_ai_events.rs b/crates/fparkan-runtime/src/clan_ai_events.rs index 30ceb573..0ccebdcb 100644 --- a/crates/fparkan-runtime/src/clan_ai_events.rs +++ b/crates/fparkan-runtime/src/clan_ai_events.rs @@ -72,6 +72,9 @@ pub(super) fn resolve_captures( ); } } + if let Some(patrol) = &mut loaded.unit_patrol { + patrol.clear_capture_passage(approach.unit, approach.target); + } loaded.clan_ai_events.capture_orders.remove(index); let clan = usize::from(owner.0); let ai = &mut loaded.clan_ai_events; @@ -810,7 +813,9 @@ impl LoadedMissionState { ); if let Some(approach) = approach { self.clan_ai_events.capture_orders.push((OwnerId(clan as u16), problem.key, approach)); - *self.clan_ai_events.capture_approaches.entry((approach.unit.slot, approach.target.slot)).or_default() += 1; + if approach.fallback { + *self.clan_ai_events.capture_approaches.entry((approach.unit.slot, approach.target.slot)).or_default() += 1; + } } return Ok(Some(VarSetDefault::Dword(u32::from(approach.is_some())))); } -- cgit v1.2.3