From 999d8dd743ce39f38b20ad3e8c8e4df391e3ae94 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 22:07:31 +0400 Subject: fix(ai): propagate problem priority to dependent orders Read Handler(12) from the active problem, as verified by calling ai.dll. The Two Fortresses transport section now submits its dependent production request. Transport assignment and design selection are still uncovered. --- crates/fparkan-runtime/src/clan_ai_events.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/fparkan-runtime/src') diff --git a/crates/fparkan-runtime/src/clan_ai_events.rs b/crates/fparkan-runtime/src/clan_ai_events.rs index 43bcf02f..d82014ec 100644 --- a/crates/fparkan-runtime/src/clan_ai_events.rs +++ b/crates/fparkan-runtime/src/clan_ai_events.rs @@ -135,6 +135,21 @@ impl LoadedMissionState { bundle.formula_table.as_ref(), &mut state.values, |instruction, values| match instruction.dispatch_selector() { + ScriptDispatchSelector::Handler(9) + if instruction.references.is_empty() + && instruction.header_words[1] == u32::MAX => + { + Ok(None) + } + ScriptDispatchSelector::Handler(12) + if instruction.references.is_empty() => + { + let priority = problem + .as_ref() + .ok_or("Handler(12) requires a current problem")? + .scalar_1; + Ok(Some(VarSetDefault::FloatBits(priority.to_bits()))) + } ScriptDispatchSelector::Handler(59 | 60) => { crate::script_time::result(instruction, values, clock) .map(|result| Some(VarSetDefault::Dword(result))) -- cgit v1.2.3