fvtt-fria-ligan / morkborg-foundry-vtt

An unoffical, community-supported system for playing MÖRK BORG on Foundry VTT.
Other
33 stars 17 forks source link

Request: Selecting "minus" on an item of 1, deletes it #165

Closed boo13 closed 1 year ago

boo13 commented 1 year ago

It'd be great if when I select the minus button on an item on my character sheet (e.g. Dried Food or Waterskin) that when that item reached 1, the minus button would then delete that item from inventory. At least, it felt like the expected behavior to me.

I'm not an expert, but having just glanced through the project, I believe here if you were to call removeItem when quantity is 1 that'd do the trick.

async decrementQuantity() {
    // can't reduce quantity below one
    if (this.system.quantity > 1) {
      return this.update({ ["data.quantity"]: this.system.quantity - 1 });
    }
  }
mcglincy commented 1 year ago

Fixed in upcoming 2.6.0.