Update CommandGift.java

Cancel if partner's inventory is full when gifting
This commit is contained in:
peacefulfarms 2019-06-28 00:00:46 -04:00 committed by GitHub
parent 859454cb57
commit 51f7b69c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,11 @@ public class CommandGift extends Command {
reply(Message.NO_ITEM);
return;
}
if(partner.getInventory().firstEmpty() == -1) {
reply(Message.PARTNER_INVENTORY_FULL);
return;
}
partner.getInventory().addItem(item.clone());
player.setItemInHand(null);