Fixed a bug that could cause item loss when depositing to a near-maxed bank stack

This commit is contained in:
Ceikry
2023-01-19 01:02:56 +00:00
committed by Ryan
parent f124e27f33
commit cb753f2a12
@@ -231,8 +231,9 @@ public final class BankContainer extends Container {
int maxCount = super.getMaximumAdd(add); int maxCount = super.getMaximumAdd(add);
if (amount > maxCount) { if (amount > maxCount) {
amount = maxCount; add.setAmount(maxCount);
if (amount < 1) { item.setAmount(maxCount);
if (maxCount < 1) {
player.getPacketDispatch().sendMessage("There is not enough space left in your bank."); player.getPacketDispatch().sendMessage("There is not enough space left in your bank.");
return; return;
} }