resource stacking bug
This commit is contained in:
@@ -1241,7 +1241,7 @@ public class CharacterItemManager {
|
||||
|
||||
// This adds item to inventory for loot. Validity checks already handled
|
||||
public synchronized boolean addItemToInventory(Item i) {
|
||||
if (i.getItemBase().getType().equals(ItemType.GOLD))
|
||||
if (i.getItemBase().getType().equals(ItemType.GOLD)) {
|
||||
if (this.absCharacter.getObjectType() == GameObjectType.Mob) {
|
||||
if (this.goldInventory == null)
|
||||
loadGoldItems();
|
||||
@@ -1252,13 +1252,22 @@ public class CharacterItemManager {
|
||||
updateInventory();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
if(ItemBase.getItemBase(i.getItemBaseID()).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) {
|
||||
int count = i.getNumOfItems();
|
||||
for(Item item : this.inventory){
|
||||
if(item.getItemBaseID() == i.getItemBaseID()){
|
||||
if(item.getNumOfItems() + count <= Warehouse.getMaxResources().get(i.getItemBaseID())){
|
||||
this.junk(item);
|
||||
count += item.getNumOfItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.inventory.add(i);
|
||||
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user