From 278b7cd95fc0117be6125fe75e67a713087ee200 Mon Sep 17 00:00:00 2001 From: Byroks Date: Wed, 6 Dec 2023 14:48:49 +0100 Subject: [PATCH] Fix Armor misscalculation Changes: + mod operation "add" can't go into negative numbers --- source/module/actors/M5ModAggregate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module/actors/M5ModAggregate.ts b/source/module/actors/M5ModAggregate.ts index cd492ed..702d52b 100644 --- a/source/module/actors/M5ModAggregate.ts +++ b/source/module/actors/M5ModAggregate.ts @@ -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);