diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 21:07:31 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 21:07:31 +0300 |
| commit | 999d8dd743ce39f38b20ad3e8c8e4df391e3ae94 (patch) | |
| tree | 43ecb7a1111f695a7255db2bcf2e74679eb53882 /crates | |
| parent | 1d92ac712c970cce8cea3eacd34d4033f80c543b (diff) | |
| download | fparkan-999d8dd743ce39f38b20ad3e8c8e4df391e3ae94.tar.xz fparkan-999d8dd743ce39f38b20ad3e8c8e4df391e3ae94.zip | |
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.
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/fparkan-runtime/src/clan_ai_events.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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))) |
