diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 15:32:40 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 15:32:40 +0300 |
| commit | ce3348883350d21821aed720a098b8515077564d (patch) | |
| tree | 939492e2d1cc88db9130fe1c187d59fc405dd60f /crates/fparkan-runtime/src/lib.rs | |
| parent | acd4c5b109bfa0c089e109160b33104f8596b0c2 (diff) | |
| download | fparkan-ce3348883350d21821aed720a098b8515077564d.tar.xz fparkan-ce3348883350d21821aed720a098b8515077564d.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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<SpawnedUnit>, + /// Buildings completed by scripted construction on this tick. + pub constructed_buildings: Vec<SpawnedUnit>, /// Diagnostic for a production order whose unit could not be created. pub production_failure: Option<String>, /// 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, |
