Tweak the way that the logic for usedCapacity is working to make it correct and bit easier to read
This commit is contained in:
parent
0f28e23b5c
commit
be31e98dea
1 changed files with 4 additions and 10 deletions
|
|
@ -6,16 +6,10 @@ export class DotDungeonItem extends Item {
|
||||||
};
|
};
|
||||||
|
|
||||||
get usedCapacity() {
|
get usedCapacity() {
|
||||||
let capacity = 0;
|
if (!this.system.uses_inventory_slot) return 0;
|
||||||
if (
|
if (!this.system.quantity_affects_used_capacity) {
|
||||||
this.system.uses_inventory_slot
|
return 1;
|
||||||
&& (this.system.quantity === undefined || this.system.quantity > 0)
|
|
||||||
) {
|
|
||||||
capacity = 1;
|
|
||||||
};
|
};
|
||||||
if (this.system.quantity_affects_used_capacity) {
|
return this.system.quantity;
|
||||||
capacity = this.system.quantity;
|
|
||||||
};
|
|
||||||
return capacity;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue