From b5cffae778eb8c50b17e5c558475e04efc2fa224 Mon Sep 17 00:00:00 2001 From: Byroks Date: Wed, 6 Dec 2023 14:49:12 +0100 Subject: [PATCH] Fix Armor misscalculation (#46) 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);