fantasycalendar/FoundryVTT-ItemPiles

[BUG] - [Item Piles] - itemPileFlags not setting flag

Closed this issue · 1 comments

Are you on the latest version of Item Piles?
Yes

Have you tried to reset Item Piles' system settings?
No

Describe the bug

const itemUUID = "Compendium.world.aederin-magical-items.Item.raHuGpySjm4kircr";

let item = await fromUuid(itemUUID);

if (!item) {
  ui.notifications.error("Item not found.");
  return;
}

let itemData = duplicate(item.toObject());
itemData.system.quantity = 15; 

const tokenImageUrl = "FA_Mapmaking_Pack/Decor/Clutter/Arranged_Clutter/Table_Arrangement_E28_2x2.png";

let pile = await game.itempiles.API.createItemPile({
  position: {
    x: token.x,
    y: token.y
  },
  tokenOverrides: {
    img: tokenImageUrl,
    width: 1,
    height: 1,
    name: "Bland Food & Water"
  },
  itemPileFlags: {
    "deleteWhenEmpty": true,
    "displayOne": false,
    "showItemName": false
  },
  items: [
    {
      item: itemData,
      quantity: 15
    }
  ]
});

I use this code as an item macro. As far as I can see, it SHOULD set the itemPileFlags as above on the pile that is being created. But for some reason the pile is instead just using the default pile settings.

It can be run directly as macro too, with token selected.

To Reproduce
Run above as item macro.
Pile is created as expected, but the flags aren't being set.

Expected behavior
itemPileFlags should be set instead of default item pile flags?

Setup:

  • Foundry Version: V12 330
  • System Version: DND5e 3.3.1
  • Item Piles Version: 3.0.8
  • Browser & version: Chrome

Active modules:

  • Item Piles
  • libwrapper
  • socketlib

Fixed in 3.0.10