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-msh/src/hallway.rs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'crates/fparkan-msh/src/hallway.rs') diff --git a/crates/fparkan-msh/src/hallway.rs b/crates/fparkan-msh/src/hallway.rs index d0d646d8..5145c3df 100644 --- a/crates/fparkan-msh/src/hallway.rs +++ b/crates/fparkan-msh/src/hallway.rs @@ -5,8 +5,17 @@ use crate::{read_f32, read_u32, MshError, NodeId, RawStream}; pub struct Hallway { /// Points in native selection order. pub points: Vec, - /// Start and end point indexes for each authored link. - pub links: Vec<[u32; 2]>, + /// Authored links between passage points. + pub links: Vec, +} + +/// A passage connection and its four directional access pairs. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct HallwayLink { + /// Start and end point indexes. + pub endpoints: [u32; 2], + /// Raw pairs of device key and state mask. + pub access: [[u32; 2]; 4], } /// A navigation point attached to a mesh node. @@ -48,7 +57,16 @@ pub(super) fn parse(stream: &RawStream) -> Result { .collect::>()?; let links = link_bytes .chunks_exact(LINK_BYTES) - .map(|link| Ok([read_u32(link, 0)?, read_u32(link, 4)?])) + .map(|link| { + let mut access = [[0; 2]; 4]; + for (i, pair) in access.iter_mut().enumerate() { + *pair = [read_u32(link, 8 + i * 8)?, read_u32(link, 12 + i * 8)?]; + } + Ok(HallwayLink { + endpoints: [read_u32(link, 0)?, read_u32(link, 4)?], + access, + }) + }) .collect::>()?; Ok(Hallway { points, links }) } @@ -124,7 +142,8 @@ mod tests { node: NodeId(4), } ); - assert_eq!(hallway.links, [[1, 0]]); + assert_eq!(hallway.links[0].endpoints, [1, 0]); + assert_eq!(hallway.links[0].access, [[0; 2]; 4]); assert_eq!(hallway.hero_exits(5).unwrap(), [(NodeId(2), [0.0; 3])]); } } -- cgit v1.2.3