From 58910ebe71100617abf6523827e2b04351709de9 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 21:03:39 +0400 Subject: feat(ai): dispatch periodic clan problem scripts Runs the supported Problems0 prefix for AI clans and counts every stop by clan, event and instruction. Single.01 now reaches the native scenario body and identifies Handler(49) as the next unsupported command. Existing defensive behavior remains active. --- apps/fparkan-game/src/main.rs | 1 + apps/fparkan-game/src/script_coverage.rs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 4d8e4b27..40fe8f3f 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -220,6 +220,7 @@ fn run(args: &[String]) -> Result { for stop in &report.mission_event_stops { log_mission_event_stop(stop); } + script_coverage::log_clan_ai_stops(&report); if guard_clans != 0 { eprintln!( "mission_guard_combat first_shot_ms={:?} first_destroyed_ms={:?}", diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs index 1cf1f544..0b0eea99 100644 --- a/apps/fparkan-game/src/script_coverage.rs +++ b/apps/fparkan-game/src/script_coverage.rs @@ -1,4 +1,6 @@ -use fparkan_runtime::{loaded_mission_script_bundles, Engine, MissionScriptInitExecution}; +use fparkan_runtime::{ + loaded_mission_script_bundles, Engine, MissionScriptInitExecution, SimulationReport, +}; pub(super) fn log_script_init(engine: &Engine, mission: &str) { for bundle in loaded_mission_script_bundles(engine).unwrap_or_default() { @@ -17,3 +19,12 @@ pub(super) fn log_script_init(engine: &Engine, mission: &str) { } } } + +pub(super) fn log_clan_ai_stops(report: &SimulationReport) { + for (stop, count) in &report.clan_ai_event_stops { + eprintln!( + "sim_coverage script_clan_ai_stops={count} clan={} script={} event={} instruction={} reason={}", + stop.clan_index, stop.script_path, stop.event_index, stop.instruction_index, stop.reason, + ); + } +} -- cgit v1.2.3