Browse Source

resource dupe

lakebane-master
FatBoy-DOTC 8 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 { @@ -1254,16 +1254,16 @@ public class CharacterItemManager {
}
return false;
}
} else if (i.getItemBase().getType().equals(ItemType.RESOURCE)) {
if(this.inventoryContainsResource(i)){
Item resource = getResource(i);
if(resource != null){
resource.setNumOfItems(resource.getNumOfItems() + i.getNumOfItems());
return true;
}
}
}
} //else if (i.getItemBase().getType().equals(ItemType.RESOURCE)) {
// if(this.inventoryContainsResource(i)){
// Item resource = getResource(i);
// if(resource != null){
// resource.setNumOfItems(resource.getNumOfItems() + i.getNumOfItems());
// return true;
// }
//}
// }
this.inventory.add(i);
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal());
return true;

Loading…
Cancel
Save