From ce3348883350d21821aed720a098b8515077564d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 16:32:40 +0400 Subject: fix(render): reveal buildings when scripted construction ends Publish completed constructions with the same fresh world snapshot that the render tick consumes. Activate their prepared render roots and collision bindings through the existing spawn path. An unmodified Third Part start shows the actual factory appearing on the site between two Vulkan frames. Terrain rebuilding for a new basement remains open. --- crates/fparkan-runtime/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/lib.rs') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 3b177b0a..312774ff 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -1411,6 +1411,8 @@ pub struct FrameResult { pub autodemo_reinforcement_unavailable: usize, /// Robot completed by a player factory order on this tick. pub produced_unit: Option, + /// Buildings completed by scripted construction on this tick. + pub constructed_buildings: Vec, /// Diagnostic for a production order whose unit could not be created. pub production_failure: Option, /// Technology completed by a player laboratory order on this tick. @@ -2949,7 +2951,10 @@ pub fn step_headless( .loaded .as_mut() .and_then(|state| state.tick_mission_event(&engine.world, queue_time_ms)); - let clan_notices = clan_ai_events::tick(engine, queue_time_ms); + let (clan_notices, constructed_buildings) = clan_ai_events::tick(engine, queue_time_ms); + if !constructed_buildings.is_empty() { + snapshot = fparkan_world::world_snapshot(&engine.world, snapshot.events); + } let researched_component = engine .loaded .as_mut() @@ -2963,6 +2968,7 @@ pub fn step_headless( autodemo_reinforcements, autodemo_reinforcement_unavailable, produced_unit, + constructed_buildings, production_failure, researched_component, player_footstep: None, -- cgit v1.2.3