diff --git a/changelog.md b/changelog.md index 1cbe911b..42d2a748 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Item Piles Changelog +## Version 2.8.9 + +- Minor fix to vault expanders not being able to be added to vaults + ## Version 2.8.8 - Added support for asymmetrical item sizes in vaults diff --git a/src/API/private-api.js b/src/API/private-api.js index 452c0d5c..52ce2053 100644 --- a/src/API/private-api.js +++ b/src/API/private-api.js @@ -1636,8 +1636,8 @@ export default class PrivateAPI { let flagData = PileUtilities.getItemFlagData(dropData.itemData.item); if (!sourceIsVault && targetIsVault) { - setProperty(flagData, "x", dropData.gridPosition.x); - setProperty(flagData, "y", dropData.gridPosition.y); + setProperty(flagData, "x", dropData.gridPosition?.x ?? 0); + setProperty(flagData, "y", dropData.gridPosition?.y ?? 0); } setProperty(dropData.itemData, CONSTANTS.FLAGS.ITEM, flagData); diff --git a/src/stores/vault-store.js b/src/stores/vault-store.js index 880eac57..638eb90d 100644 --- a/src/stores/vault-store.js +++ b/src/stores/vault-store.js @@ -351,12 +351,12 @@ export class VaultStore extends ItemPileStore { return false; } - let validPosition = null; + let validPosition = { x: 0, y: 0 }; let similarItem = this.getSimilarItem(itemData); if (!vaultExpander) { if (similarItem && PileUtilities.canItemStack(item, this.actor)) { const { x, y } = PileUtilities.getItemFlagData(similarItem); - validPosition = { x, y }; + validPosition = { x: Math.max(x, 0), y: Math.max(y, 0) }; } else { validPosition = PileUtilities.canItemFitInVault(itemData, this.actor, { x, y }); if (!validPosition) {