From c374b6e4b219f9dccaf09c8b709f243ad6eb4290 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 20:06:12 +0400 Subject: fix(script): continue clan Init past the research stub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Оставляем строгую загрузку прежней. В игровом режиме команда без результата отмечена по клану и номеру инструкции, следующие команды исполняются. На штатных ресурсах все 29 миссий запускаются, 12 вызовов дошли до заглушки, а Single.01 завершила Init без обрыва. --- crates/fparkan-script/src/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/fparkan-script') diff --git a/crates/fparkan-script/src/lib.rs b/crates/fparkan-script/src/lib.rs index cacbbd5b..b5b543fe 100644 --- a/crates/fparkan-script/src/lib.rs +++ b/crates/fparkan-script/src/lib.rs @@ -810,6 +810,22 @@ impl VarSet { input: Handler19InitInput, formulas: Option<&FormulaTable>, clan_count: impl Fn(u32, u32) -> Option, + ) -> Result, ScriptInitResolveError> { + self.resolve_init_prefix_with_host(package, input, formulas, clan_count, |_, _| false) + } + + /// Allows the host to handle an unsupported instruction that has no variable writes. + /// + /// # Errors + /// + /// Returns the same errors as [Self::resolve_init_prefix]. + pub fn resolve_init_prefix_with_host( + &self, + package: &ScriptPackage, + input: Handler19InitInput, + formulas: Option<&FormulaTable>, + clan_count: impl Fn(u32, u32) -> Option, + mut handle: impl FnMut(usize, &ScriptInstruction) -> bool, ) -> Result, ScriptInitResolveError> { let Some((event_index, event)) = package.events.iter().enumerate().find(|(_, event)| { event.name_raw.split(|byte| *byte == 0).next() == Some(&b"Init"[..]) @@ -849,6 +865,9 @@ impl VarSet { prefix.writes.extend(instruction_writes); } InitInstructionResolution::Unsupported(error) => { + if handle(instruction_index, instruction) { + continue; + } prefix.stopped_at = Some((instruction_index, error)); break; } -- cgit v1.2.3