From cf0b9a0ae0e0d108bdb6c69d68366091a68fe43a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 24 Feb 2024 13:54:16 -0500 Subject: [PATCH] Bugfix in variable name. "None" support. --- src/engine/objects/ItemTemplate.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 1d488c18..91817e6a 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -102,7 +102,7 @@ public class ItemTemplate { JSONArray eq_slots_and = (JSONArray) jsonObject.get("item_eq_slots_and"); if (eq_slots_and.isEmpty() == false) - for (Object o : eq_slots_or) + for (Object o : eq_slots_and) item_eq_slots_and.add(Enum.ItemEquipSlotType.valueOf((String) o)); item_value = ((Long) jsonObject.get("item_value")).intValue(); @@ -144,8 +144,11 @@ public class ItemTemplate { JSONArray itemflags = (JSONArray) jsonObject.get("item_flags"); if (itemflags.isEmpty() == false) - for (Object o : itemflags) - item_flags.add(Enum.ItemFlags.valueOf((String) o)); + for (Object o : itemflags) { + String flag = (String) o; + if (flag.equals("None") == false) + item_flags.add(Enum.ItemFlags.valueOf((String) o)); + } JSONArray itemUseflags = (JSONArray) jsonObject.get("item_use_flags");