Add bank area checks back since previously you could open a bank, and as long as you didn't open another interface you could abuse it (#301)

This commit is contained in:
Daniel Ginovker
2019-12-17 15:19:39 -05:00
committed by GitHub
parent 223c3194a8
commit 62a22f8857
@@ -1806,7 +1806,7 @@ public class ItemAssistant {
return false; return false;
} }
if (!(c.lastMainFrameInterface == MainFrameIDs.DEPOSIT_BOX || c.lastMainFrameInterface == MainFrameIDs.BANK)) { //Packet exploit prevention if (!(c.lastMainFrameInterface == MainFrameIDs.DEPOSIT_BOX || c.lastMainFrameInterface == MainFrameIDs.BANK || c.inBankArea())) { //Packet exploit prevention
c.getPacketSender().sendMessage("You don't have a bank open! Report this ID to developers: " + c.lastMainFrameInterface); c.getPacketSender().sendMessage("You don't have a bank open! Report this ID to developers: " + c.lastMainFrameInterface);
return false; return false;
} }
@@ -2093,7 +2093,7 @@ public class ItemAssistant {
public void fromBank(int itemID, int fromSlot, int amount) { public void fromBank(int itemID, int fromSlot, int amount) {
boolean cantWithdrawCuzMaxStack = false; boolean cantWithdrawCuzMaxStack = false;
if (c.lastMainFrameInterface != MainFrameIDs.BANK) if (!(c.lastMainFrameInterface == MainFrameIDs.BANK || c.inBankArea()))
{ {
c.getPacketSender().sendMessage("Your bank isn't open!"); c.getPacketSender().sendMessage("Your bank isn't open!");
return; return;