diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 6ceb02ea..9615b3d0 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -13,7 +13,6 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; @@ -64,9 +63,13 @@ public class ItemTemplate { combat_attack_resist.put((String) key, resist); } + // Reading arraylist of ints + JSONArray combat_json = (JSONArray) jsonObject.get("combat_powers"); - combatPowers = (ArrayList) Arrays.asList(combat_json.toArray()); + if (combat_json.isEmpty() == false) + for (Object o : combat_json) + combatPowers.add(o); } }