From 27d6ea19b0206b71ef6c309142e0875275882bf0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 15:20:46 +0400 Subject: fix(ai): account for pending construction in class limits Implement Handler(11) limits for the original class set, including hangar and laboratory counters. Keep owned-object caps separate from pending thresholds; medium and large towers allow three and one active builds. Record the ordered class on construction tasks and count queries by clan, class and result. Execute ai.dll RVA 0xc5e7 with the GOG hash guard and compare owned counts, maxima, pending counts and unknown classes. Preserve these native vectors in a Rust test. Extend the licensed construction test to require pending count before registration, owner isolation and reset after completion. Validate fmt, workspace check/tests, licensed construction, release build and stock mission 29 in simulation and its window. This removes the Handler(11) coverage blocker for the following construction work; generic building orders and Handler(40) are still open. Pending counter sources and lifecycle beyond active FParkan Construction tasks remain approximate. --- apps/fparkan-game/src/script_coverage.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/fparkan-game/src/script_coverage.rs') diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs index c7020e73..1f777186 100644 --- a/apps/fparkan-game/src/script_coverage.rs +++ b/apps/fparkan-game/src/script_coverage.rs @@ -21,6 +21,9 @@ pub(super) fn log_script_init(engine: &Engine, mission: &str) { } pub(super) fn log_clan_ai_stops(report: &SimulationReport) { + for &(clan, class, blocked, count) in &report.script_class_limit_queries { + eprintln!("sim_coverage script_class_limit_approx={count} clan={clan} class={class:#010x} blocked={blocked}"); + } for &(unit, order, count) in &report.script_unit_order_counts { eprintln!("sim_coverage script_unit_queue_approx={count} unit={unit} order={order}"); } -- cgit v1.2.3