Skip to content

Commit

Permalink
Fix prototype token not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Jan 11, 2022
1 parent fd399fd commit 6488348
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 7 additions & 1 deletion scripts/lib/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

}
Expand Down

0 comments on commit 6488348

Please sign in to comment.