diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 19:24:14 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 19:24:14 +0300 |
| commit | 1912d5a0c6aa405f8e17d6b065eed33a7f687fbb (patch) | |
| tree | 3203d680b1b8dc58bcaa1f61031baca00018aeb1 /crates/fparkan-runtime/src | |
| parent | 71ae57fb95805e6262aa70fc4890dcad91ab3ea1 (diff) | |
| download | fparkan-1912d5a0c6aa405f8e17d6b065eed33a7f687fbb.tar.xz fparkan-1912d5a0c6aa405f8e17d6b065eed33a7f687fbb.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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(); |
