From a124d9021e14c4e2b68b72aa70dc1508abe7c2c8 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 21:50:17 +0400 Subject: fix(production): let separate factories build concurrently Reserve each slot at order time and advance one order per live factory. Hostile completion no longer changes the player's status. A stock Two Fortresses regression starts the player's factory during an enemy job and observes completions from both. --- crates/fparkan-runtime/src/player_status.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/fparkan-runtime/src/player_status.rs') diff --git a/crates/fparkan-runtime/src/player_status.rs b/crates/fparkan-runtime/src/player_status.rs index 637f5254..882ccf33 100644 --- a/crates/fparkan-runtime/src/player_status.rs +++ b/crates/fparkan-runtime/src/player_status.rs @@ -1,6 +1,16 @@ use crate::{Engine, MissionControlNodeProviderTableStatus}; use fparkan_world::{handle_by_original_id, identity_metadata, ObjectHandle}; +/// Reports whether this clan is controlled by the player. +#[must_use] +pub fn is_player_clan(engine: &Engine, clan: u16) -> bool { + engine + .loaded + .as_ref() + .and_then(|mission| mission.mission.clans.get(usize::from(clan))) + .is_some_and(|clan| clan.mode == 1) +} + /// Current values for the player's controlled unit and clan. #[derive(Clone, Copy, Debug, PartialEq)] pub struct PlayerStatus { -- cgit v1.2.3