From be31e98dea071899e78ad360e8f9b36e4a1c143c Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 30 Mar 2024 13:00:05 -0600 Subject: [PATCH] Tweak the way that the logic for usedCapacity is working to make it correct and bit easier to read --- module/documents/Item/GenericItem.mjs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/module/documents/Item/GenericItem.mjs b/module/documents/Item/GenericItem.mjs index 247d37c..eb8b7c1 100644 --- a/module/documents/Item/GenericItem.mjs +++ b/module/documents/Item/GenericItem.mjs @@ -6,16 +6,10 @@ export class DotDungeonItem extends Item { }; get usedCapacity() { - let capacity = 0; - if ( - this.system.uses_inventory_slot - && (this.system.quantity === undefined || this.system.quantity > 0) - ) { - capacity = 1; + if (!this.system.uses_inventory_slot) return 0; + if (!this.system.quantity_affects_used_capacity) { + return 1; }; - if (this.system.quantity_affects_used_capacity) { - capacity = this.system.quantity; - }; - return capacity; + return this.system.quantity; }; };