diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index 5861ea6e..f1f45c95 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -1257,25 +1257,17 @@ public class CharacterItemManager { } if(ItemBase.getItemBase(i.getItemBaseID()).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) { int count = i.getNumOfItems(); - ArrayList purge = new ArrayList<>(); for(Item item : this.inventory){ if(item.getItemBaseID() == i.getItemBaseID()){ if(item.getNumOfItems() + count <= Warehouse.getMaxResources().get(i.getItemBaseID())){ - purge.add(item); + count += item.getNumOfItems(); + delete(item); } } } - for(Item item : purge){ - count += item.getNumOfItems(); - //this.removeItemFromInventory(item); - //item.setOwner(null); - junk(item); - - } Item resource = new MobLoot(this.getOwner(),i.getItemBase(),count,false).promoteToItem((PlayerCharacter)this.getOwner()); this.inventory.add(resource); this.itemIDtoType.put(resource.getObjectUUID(), resource.getObjectType().ordinal()); - this.updateInventory(purge,false); return true; } this.inventory.add(i);