Spells/Parsing

* bandaid fix parsing deeply nested formulas in non-interactive mode
   (should rethink how/when formulas get flagged as un-evalable)
This commit is contained in:
Sarjuuk
2025-10-04 00:50:27 +02:00
parent ff690770b5
commit a6108be400

View File

@@ -910,7 +910,11 @@ class SpellList extends DBTypeList
$formula = preg_replace('/(\+|-|\*|\/)(\+|-|\*|\/)/i', '\1 \2', $formula);
// there should not be any letters without a leading $
return eval('return '.$formula.';');
try { $formula = eval('return '.$formula.';'); }
// but there can be if we are non-interactive
catch (\Throwable $e) { }
return $formula;
}
// description-, buff-parsing component