Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
RedSparr0w authored Oct 6, 2021
1 parent 73cf9ad commit 10e1e47
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/objects/bank/bank.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const withdrawItem: itemInteractionActionHandler = (details) => {
}

let itemIdToAdd: number = details.itemId;
let stackable = details.itemDetails.stackable;
let stackable: boolean = details.itemDetails.stackable;
if (details.player.settings.bankWithdrawNoteMode) {
const toNoteId: number = toNote(details.itemId);
if (toNoteId > -1) {
Expand Down Expand Up @@ -172,11 +172,13 @@ export const withdrawItem: itemInteractionActionHandler = (details) => {
amount: removeFromContainer(playerBank, details.itemId, countToRemove)
};

if (stackable)
if (stackable) {
playerInventory.add({ itemId: itemToAdd.itemId, amount: itemToAdd.amount });
else
for(let count = 0; count < itemToAdd.amount; count++)
} else {
for(let count = 0; count < itemToAdd.amount; count++) {
playerInventory.add({ itemId: itemToAdd.itemId, amount: 1 });
}
}

updateBankingInterface(details.player);
};
Expand Down

0 comments on commit 10e1e47

Please sign in to comment.