Browse Source

resource dupe

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
b343f4d6d7
  1. 20
      src/engine/objects/CharacterItemManager.java

20
src/engine/objects/CharacterItemManager.java

@ -1254,16 +1254,16 @@ public class CharacterItemManager {
} }
return false; return false;
} }
} else if (i.getItemBase().getType().equals(ItemType.RESOURCE)) { } //else if (i.getItemBase().getType().equals(ItemType.RESOURCE)) {
if(this.inventoryContainsResource(i)){ // if(this.inventoryContainsResource(i)){
Item resource = getResource(i); // Item resource = getResource(i);
if(resource != null){ // if(resource != null){
resource.setNumOfItems(resource.getNumOfItems() + i.getNumOfItems()); // resource.setNumOfItems(resource.getNumOfItems() + i.getNumOfItems());
return true; // return true;
} // }
} //}
} // }
this.inventory.add(i); this.inventory.add(i);
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal()); this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal());
return true; return true;

Loading…
Cancel
Save