From d4c2ee22771b20208ee07ec38d868c3b0ce963bf Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 10:02:23 +0400 Subject: feat(runtime): replenish AutoDemo clans after combat losses --- crates/fparkan-runtime/src/mission_events.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/mission_events.rs') diff --git a/crates/fparkan-runtime/src/mission_events.rs b/crates/fparkan-runtime/src/mission_events.rs index a9b3cf9d..098cf47d 100644 --- a/crates/fparkan-runtime/src/mission_events.rs +++ b/crates/fparkan-runtime/src/mission_events.rs @@ -140,6 +140,12 @@ pub(super) struct MissionEvents { } impl MissionEvents { + pub(super) fn register_unit(&mut self, world: &World, handle: ObjectHandle, class: u32) { + self.placed_clan_objects + .retain(|(handle, _)| registration_sequence(world, *handle).is_ok()); + self.placed_clan_objects.push((handle, class)); + } + pub(super) fn with_placed_objects( world: &mut World, drafts: &[MissionObjectDraft], @@ -382,7 +388,7 @@ fn count_clan_objects( owner: OwnerId, mask: u32, ) -> u32 { - // shortcut: count placed units until production registers new objects here. + // All registered handles, including replacements, are checked against live ownership. objects .iter() .filter(|&&(handle, class)| { -- cgit v1.2.3