Fix for QuestItemLimit validating all kind of items.

Contributed by yksdtc.
This commit is contained in:
MobiusDev
2017-01-01 14:24:57 +00:00
parent eed2a2a46c
commit 7c0819964d

View File

@ -845,7 +845,7 @@ public class PcInventory extends Inventory
public boolean validateCapacity(L2ItemInstance item) public boolean validateCapacity(L2ItemInstance item)
{ {
int slots = 0; int slots = 0;
if (!item.isStackable() || (getInventoryItemCount(item.getId(), -1) <= 0) || !item.getItem().hasExImmediateEffect()) if (!item.isStackable() || ((getInventoryItemCount(item.getId(), -1) <= 0) && !item.getItem().hasExImmediateEffect()))
{ {
slots++; slots++;
} }
@ -876,7 +876,7 @@ public class PcInventory extends Inventory
public boolean validateCapacity(long slots, boolean questItem) public boolean validateCapacity(long slots, boolean questItem)
{ {
return (getSize(item -> !item.isQuestItem() || questItem) + slots) <= _owner.getQuestInventoryLimit(); return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit();
} }
@Override @Override