From 1912d5a0c6aa405f8e17d6b065eed33a7f687fbb Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 20:24:14 +0400 Subject: fix(script): evaluate products before adding formula terms Reuses the original operand formats and rounds each product before adding or subtracting. The original ai.dll agreed on three campaign difficulty expressions. Mission 19 now reaches comparison branches in Init. --- crates/fparkan-runtime/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/fparkan-runtime') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index c86b6b01..6bd697a8 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -16006,7 +16006,7 @@ mod tests { #[test] fn handler_nineteen_preview_keeps_unsupported_package_without_partial_writes() { let formula_table = - FormulaTable::parse(b"FUNCTION(add, x + 2, )\nFUNCTION(unsupported, x * 2, )\n"); + FormulaTable::parse(b"FUNCTION(add, x + 2, )\nFUNCTION(unsupported, x / 2, )\n"); let varset = MissionScriptVarSet { path: FALLBACK_SCRIPT_VARSET_PATH.to_string(), used_fallback: true, @@ -16068,7 +16068,7 @@ mod tests { instruction_index: 2, error: ScriptInitResolveError::UnsupportedFormulaExpression { index: 1, - expression: b" x * 2".to_vec(), + expression: b" x / 2".to_vec(), }, } ); @@ -16168,7 +16168,7 @@ mod tests { expression, }, .. - }) if expression == b" x * 2" + }) if expression == b" x / 2" )); let mut malformed_package = package.clone(); -- cgit v1.2.3