Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage authored Oct 17, 2024
2 parents a747985 + ee02bf4 commit 117cdf3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,21 @@ const InventoryContainer = Vue.createApp({
if (sourceItem.amount < amountToTransfer) {
throw new Error("Insufficient amount of item in source inventory");
}
if (targetInventoryType == "other")
{

if (targetInventoryType !== this.dragStartInventoryType) {
if (targetInventoryType == "other") {
const totalWeightAfterTransfer = this.otherInventoryWeight + sourceItem.weight * amountToTransfer;
if (totalWeightAfterTransfer > this.otherInventoryMaxWeight) {
throw new Error("Insufficient weight capacity in target inventory");
}
}
else if (targetInventoryType == "player")
{
else if (targetInventoryType == "player") {
const totalWeightAfterTransfer = this.playerWeight + sourceItem.weight * amountToTransfer;
if (totalWeightAfterTransfer > this.maxWeight) {
throw new Error("Insufficient weight capacity in player inventory");
}
}
}

const targetItem = targetInventory[targetSlotNumber];

Expand Down

0 comments on commit 117cdf3

Please sign in to comment.