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() {
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue