From baecdeff248806a7cbcfd4d10ab58a311305222b Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sun, 9 Oct 2022 10:10:21 +0200 Subject: [PATCH] Fixed bug where items with zero quantity have active children --- .../computation/buildComputation/computeInactiveStatus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.js b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.js index fcb2be07..5282e93e 100644 --- a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.js +++ b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.js @@ -29,8 +29,8 @@ function childrenActive(prop){ // Children of disabled properties are always inactive if (prop.disabled) return false; switch (prop.type){ - // Only equipped items have active children - case 'item': return !!prop.equipped; + // Only equipped items with non-zero quantity have active children + case 'item': return !!prop.equipped && prop.quantity !== 0; // The children of actions, spells, and triggers are always inactive case 'action': return false; case 'spell': return false;