From 0e8d4df52cb11185cc9962f5cab0077246605a8b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 20:44:49 +0400 Subject: 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. --- crates/fparkan-runtime/src/clan_script_init.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crates/fparkan-runtime/src') 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, } } @@ -101,6 +107,22 @@ mod tests { assert_eq!(stubbed_handler(&instruction, &values), None); } + #[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 { -- cgit v1.2.3