From cf6265d8ce78fcaec62f79689269a1e495c736cd Mon Sep 17 00:00:00 2001 From: Seth Posner Date: Mon, 12 Feb 2024 07:58:39 -0800 Subject: [PATCH] Keep disabled modifiers when making formulas --- src/game/modifiers.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/modifiers.tsx b/src/game/modifiers.tsx index b65e7fc..1ee3905 100644 --- a/src/game/modifiers.tsx +++ b/src/game/modifiers.tsx @@ -297,9 +297,9 @@ export function createSequentialModifier< getFormula: modifiers.every(m => m.getFormula != null) ? (gain: FormulaSource) => modifiers - .filter(m => unref(m.enabled) !== false) // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - .reduce((acc, curr) => curr.getFormula!(acc), gain) + .reduce((acc, curr) => Formula.if(acc, curr.enabled ?? true, + acc => curr.getFormula!(acc), acc => acc), gain) : undefined, enabled: modifiers.some(m => m.enabled != null) ? computed(() => modifiers.filter(m => unref(m.enabled) !== false).length > 0)