diff --git a/changelog.md b/changelog.md index 0e46c8c1..af8df4f4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Item Piles Changelog +## Version 1.1.3 +- Fixed prototype tokens not being updated when editing an item pile through its sheet + ## Version 1.1.2 - Fixed dropping items onto piles not working when it had an interaction distance of infinite - Fixed macro input field in item pile config was incorrectly set to "number" rather than "text" diff --git a/scripts/lib/lib.js b/scripts/lib/lib.js index eaf02d3d..43c04485 100644 --- a/scripts/lib/lib.js +++ b/scripts/lib/lib.js @@ -190,8 +190,14 @@ export async function updateItemPile(inDocument, flagData, tokenData){ await canvas.scene.updateEmbeddedDocuments("Token", updates); + const newPrototypeTokenData = foundry.utils.mergeObject(tokenData, { + "img": getItemPileTokenImage(documentActor, flagData), + "scale": getItemPileTokenScale(documentActor, flagData), + }); + return documentActor.update({ - [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: flagData + [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: flagData, + ...newPrototypeTokenData }); }