forked from profectus/Profectus
Compare commits
1 commit
main
...
ducdat0507
Author | SHA1 | Date | |
---|---|---|---|
|
46306ee0e7 |
1 changed files with 3 additions and 1 deletions
|
@ -1453,7 +1453,9 @@ export function calculateMaxAffordable(
|
||||||
formula.invertIntegral(Decimal.add(resource.value, formula.evaluateIntegral()))
|
formula.invertIntegral(Decimal.add(resource.value, formula.evaluateIntegral()))
|
||||||
).sub(unref(formula.innermostVariable) ?? 0);
|
).sub(unref(formula.innermostVariable) ?? 0);
|
||||||
} else {
|
} else {
|
||||||
affordable = Decimal.floor(formula.invert(resource.value));
|
affordable = Decimal.floor(
|
||||||
|
formula.invert(resource.value)
|
||||||
|
).add(1).sub(unref(formula.innermostVariable) ?? 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
affordable = Decimal.clampMax(affordable, maxBulkAmount);
|
affordable = Decimal.clampMax(affordable, maxBulkAmount);
|
||||||
|
|
Loading…
Reference in a new issue