Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Dec 19, 2023
1 parent 60989a4 commit 40810d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/API/private-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/stores/vault-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 40810d7

Please sign in to comment.