Skip to content

Commit

Permalink
Fixed containers not updating image when the contents of the item pil…
Browse files Browse the repository at this point in the history
…e changed
  • Loading branch information
Haxxer committed Mar 3, 2024
1 parent 34f3af5 commit 3f7f3b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fixed merchant activity log events being incorrectly displayed
- Fixed custom categories not being applied on items when populating merchants
- Fixed issue with item piles not updating the amount of visible currency when taking 1 unit of currency at a time
- Fixed containers not updating image when the contents of the item pile changed

## Version 2.8.20

Expand Down
7 changes: 5 additions & 2 deletions src/helpers/pile-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,12 @@ export function getItemPileName(target, { data = false, items = false, currencie
}

export function shouldEvaluateChange(target, changes) {
const flags = getActorFlagData(target, getProperty(changes, CONSTANTS.FLAGS.PILE) ?? {});
const baseFlags = getProperty(changes, CONSTANTS.FLAGS.PILE) ?? false;
const flags = getActorFlagData(target, baseFlags ? foundry.utils.deepClone(baseFlags) : baseFlags);
if (!isValidItemPile(target, flags)) return false;
return (flags.type === CONSTANTS.PILE_TYPES.CONTAINER && (flags.closedImage || flags.emptyImage || flags.openedImage || flags.lockedImage)) || flags.displayOne || flags.showItemName || flags.overrideSingleItemScale;
return (flags.type === CONSTANTS.PILE_TYPES.CONTAINER
&& (flags.closedImage || flags.emptyImage || flags.openedImage || flags.lockedImage))
|| flags.displayOne || flags.showItemName || flags.overrideSingleItemScale;
}

function getRelevantTokensAndActor(target) {
Expand Down

0 comments on commit 3f7f3b6

Please sign in to comment.