Fix Armor misscalculation
Changes: + mod operation "add" can't go into negative numbers
This commit is contained in:
parent
db23081a9a
commit
278b7cd95f
|
|
@ -126,7 +126,7 @@ export default class M5ModAggregate {
|
|||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
ret.value = ret.value + bonus;
|
||||
ret.value = Math.max(0, ret.value + bonus);
|
||||
}
|
||||
|
||||
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.SUBTRACT);
|
||||
|
|
|
|||
Loading…
Reference in New Issue