So i have ran uppon this issue on many servers, that whenever you draw your cash out the bank while having cash in your inventory the cash will disappear.
Well this is a simple and basic check. Do not judge me on the code as i only know the basics.
Please leave comments on how i can better this, helpful criticism is taken.
Class edited: itemAssistant
Difficulty: 1/10
Find method fromBank()
And declare
int amount = amountCheck;
Above amount > 0 add
if ((inInv + amountCheck) < 0) {
amount = Integer.MAX_VALUE - inInv;
}
Find method bankItem()
and declare
int amount = amountCheck;
under
i = GameSettings.BANK_SIZE + 1;
declare
int playerInBank = c.bankItemsN[toBankSlot];
And under that add the following
if ((playerInBank + amountCheck) < 0) {
amount = Integer.MAX_VALUE - playerInBank;
}
Also don't forget to declare the amountCheck in the header of the method