aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-25 14:20:46 +0300
committerValentin Popov <valentin@popov.link>2026-11-25 14:20:46 +0300
commit27d6ea19b0206b71ef6c309142e0875275882bf0 (patch)
tree2d99974f970ab652ec8fd799e26a0af4909b52bf /crates/fparkan-runtime/src/lib.rs
parent44320618ae750da0ab10e50439bf74405b9eacba (diff)
downloadfparkan-27d6ea19b0206b71ef6c309142e0875275882bf0.tar.xz
fparkan-27d6ea19b0206b71ef6c309142e0875275882bf0.zip
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.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 057ff7b8..0d43384f 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -46,6 +46,7 @@ mod boarding;
mod building_door;
mod clan_ai_events;
mod clan_area_strength;
+mod clan_build_limits;
mod clan_building_queries;
mod clan_combat_groups;
mod clan_combat_strength;
@@ -2935,6 +2936,7 @@ pub struct SimulationReport {
pub script_factory_patrol_continues: Vec<(usize, u32, u64)>,
pub script_ore_transport_orders: Vec<(usize, u32, u64)>,
pub script_building_site_queries: Vec<(usize, u32, u64)>,
+ pub script_class_limit_queries: Vec<(usize, u32, bool, u64)>,
pub script_construction_orders: Vec<(usize, u32, u32, u64, u64)>,
pub script_capturer_queries: Vec<(usize, u64)>,
pub script_capture_approaches: Vec<(u32, u32, u64)>,
@@ -2998,6 +3000,7 @@ pub fn simulate_mission_report(
script_factory_patrol_continues: Vec::new(),
script_ore_transport_orders: Vec::new(),
script_building_site_queries: Vec::new(),
+ script_class_limit_queries: Vec::new(),
script_construction_orders: Vec::new(),
script_capturer_queries: Vec::new(),
script_capture_approaches: Vec::new(),
@@ -3142,6 +3145,9 @@ pub fn simulate_mission_report(
.script_building_site_queries
.extend(loaded.clan_ai_events.building_site_queries());
report
+ .script_class_limit_queries
+ .extend(loaded.clan_ai_events.class_limit_queries());
+ report
.script_construction_orders
.extend(loaded.clan_ai_events.construction_orders());
report