You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When stacked items are withdrawn from the player's bank, a for-loop adds the items to the player's inventory one-by-one. When each new item of the stack is added, the container is updated with this._containerUpdated.next() causing the server to crash if withdrawing large quantities of items due to the large amount of refresh calls.
To Reproduce
Steps to reproduce the behavior:
Open the bank.
Withdraw a large amount of stacked items.
The server becomes unresponsive, (especially if you have items in your inventory that aren't registered with the server. Console gets flooded with item warning messages.)
Expected behavior
A single inventory add/change, instead of X amount of changes for stacked items.
Solution
In bank.plugin.ts:173, remove the for-loop and change playerInventory.add({ itemId: itemIdToAdd, amount: 1 }); to playerInventory.add({ itemId: itemIdToAdd, amount: countToRemove });
The text was updated successfully, but these errors were encountered:
Describe the bug
When stacked items are withdrawn from the player's bank, a for-loop adds the items to the player's inventory one-by-one. When each new item of the stack is added, the container is updated with
this._containerUpdated.next()
causing the server to crash if withdrawing large quantities of items due to the large amount of refresh calls.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A single inventory add/change, instead of X amount of changes for stacked items.
Solution
In bank.plugin.ts:173, remove the for-loop and change
playerInventory.add({ itemId: itemIdToAdd, amount: 1 });
toplayerInventory.add({ itemId: itemIdToAdd, amount: countToRemove });
The text was updated successfully, but these errors were encountered: