From 9e652761b86ddc3f654cf4d8c7434e5465458682 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Feb 2024 03:04:12 -0500 Subject: [PATCH] Type selection work. --- src/engine/objects/ItemTemplate.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 0ab06bc7..d7534e92 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -80,7 +80,6 @@ public class ItemTemplate { // Parsing an enum item_type = Enum.ItemType.valueOf((String) jsonObject.get("item_type")); - item_eq_slots_value = ((Long) jsonObject.get("item_eq_slots_value")).intValue(); item_eq_slots_type = (boolean) jsonObject.get("item_eq_slots_type"); @@ -108,7 +107,7 @@ public class ItemTemplate { Object skills_used = jsonObject.get("item_skill_used"); - if (skills_used instanceof JSONArray) + if ((int) skills_used != 0) for (Object o : (JSONArray) skills_used) { String skilString = ((String) o).replaceAll("\\s", ""); Enum.CharacterSkills characterSkill = Enum.CharacterSkills.valueOf(skilString); @@ -117,7 +116,7 @@ public class ItemTemplate { Object mastery_used = jsonObject.get("item_skill_mastery_used"); - if (mastery_used instanceof JSONArray) + if ((int) mastery_used != 0) for (Object o : (JSONArray) mastery_used) { String masteryString = ((String) o).replaceAll("\\s", ""); Enum.CharacterSkills masterySkill = Enum.CharacterSkills.valueOf(masteryString);