diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 19:44:49 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 19:44:49 +0300 |
| commit | 0e8d4df52cb11185cc9962f5cab0077246605a8b (patch) | |
| tree | fdd3ee648fded57a0c06340c27bfbcb7467bb2d7 | |
| parent | 2420e84d82cc1afdafc70882e51d4482dcdaad5b (diff) | |
| download | fparkan-0e8d4df52cb11185cc9962f5cab0077246605a8b.tar.xz fparkan-0e8d4df52cb11185cc9962f5cab0077246605a8b.zip | |
fix(script): continue Init past the uncovered AI setting
Handler(69) writes an AI field for nonnegative DWORD operands. Until its consumer is modeled, the observed form is counted as a stub. Mission 10 now runs the subsequent shutdown and patrol orders and finishes clan Init.
| -rw-r--r-- | crates/fparkan-runtime/src/clan_script_init.rs | 22 | ||||
| -rw-r--r-- | docs/appendices/knowledge-boundaries.md | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/clan_script_init.rs b/crates/fparkan-runtime/src/clan_script_init.rs index a827df14..891cc5a3 100644 --- a/crates/fparkan-runtime/src/clan_script_init.rs +++ b/crates/fparkan-runtime/src/clan_script_init.rs @@ -66,6 +66,12 @@ pub(super) fn stubbed_handler( { Some(68) } + // shortcut: resume Init until the AI consumer of this setting is wired. + ([69, u32::MAX, u32::MAX, u32::MAX, 6, 1, u32::MAX], [index]) + if matches!(values.get(*index as usize), Some(VarSetDefault::Dword(_))) => + { + Some(69) + } _ => None, } } @@ -102,6 +108,22 @@ mod tests { } #[test] + fn ai_setting_stub_requires_a_dword_operand_and_no_result() { + let mut instruction = ScriptInstruction { + header_words: [69, u32::MAX, u32::MAX, u32::MAX, 6, 1, u32::MAX], + references: vec![0], + }; + let values = [VarSetDefault::Dword(15)]; + assert_eq!(stubbed_handler(&instruction, &values), Some(69)); + assert_eq!( + stubbed_handler(&instruction, &[VarSetDefault::FloatBits(0)]), + None + ); + instruction.header_words[1] = 0; + assert_eq!(stubbed_handler(&instruction, &values), None); + } + + #[test] fn reservation_reads_logical_id_and_treats_every_nonzero_flag_as_set() { let instruction = ScriptInstruction { header_words: [51, u32::MAX, u32::MAX, u32::MAX, 6, 2, u32::MAX], diff --git a/docs/appendices/knowledge-boundaries.md b/docs/appendices/knowledge-boundaries.md index fd80b349..4fecb133 100644 --- a/docs/appendices/knowledge-boundaries.md +++ b/docs/appendices/knowledge-boundaries.md @@ -428,6 +428,9 @@ core и `ResearchCandidateSet::refresh_selection`: последний получ `script_init_handler_stub` также отмечает вещественную команду `Handler(68)`. В GOG `ai.dll` RVA `0xefe1` принимает положительное значение и вызывает пересчёт области базы по RVA `0x6700`. Запись и пересчёт состояния AI открыты. +`Handler(69)` по RVA `0xf06c` записывает неотрицательный DWORD в поле AI +`+0x41c`. Игровой `Init` учитывает эту форму как заглушку до подключения +потребителя поля к логике AI. Начальный массив слота AI `+0x38` теперь восстановлен отдельно от этого исследовательского пути. В `iron3d.dll` SHA-256 |
