mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-25 01:41:44 +00:00
Fix infinite loops in calculating max affordable
This commit is contained in:
parent
b6a3c49cc5
commit
ff1ace0609
1 changed files with 2 additions and 1 deletions
|
@ -1458,7 +1458,8 @@ export function calculateMaxAffordable(
|
|||
}
|
||||
while (
|
||||
Decimal.lt(affordable, maxBulkAmount) &&
|
||||
Decimal.lt(affordable, Number.MAX_SAFE_INTEGER)
|
||||
Decimal.lt(affordable, Number.MAX_SAFE_INTEGER) &&
|
||||
Decimal.add(directSum, 1).gte(affordable)
|
||||
) {
|
||||
const nextCost = formula.evaluate(
|
||||
affordable.add(unref(formula.innermostVariable) ?? 0)
|
||||
|
|
Loading…
Reference in a new issue