Bugfix in variable name. "None" support.

This commit is contained in:
2024-02-24 13:54:16 -05:00
parent 2b65e23b48
commit cf0b9a0ae0
+6 -3
View File
@@ -102,7 +102,7 @@ public class ItemTemplate {
JSONArray eq_slots_and = (JSONArray) jsonObject.get("item_eq_slots_and"); JSONArray eq_slots_and = (JSONArray) jsonObject.get("item_eq_slots_and");
if (eq_slots_and.isEmpty() == false) 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_eq_slots_and.add(Enum.ItemEquipSlotType.valueOf((String) o));
item_value = ((Long) jsonObject.get("item_value")).intValue(); item_value = ((Long) jsonObject.get("item_value")).intValue();
@@ -144,8 +144,11 @@ public class ItemTemplate {
JSONArray itemflags = (JSONArray) jsonObject.get("item_flags"); JSONArray itemflags = (JSONArray) jsonObject.get("item_flags");
if (itemflags.isEmpty() == false) if (itemflags.isEmpty() == false)
for (Object o : itemflags) for (Object o : itemflags) {
item_flags.add(Enum.ItemFlags.valueOf((String) o)); 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"); JSONArray itemUseflags = (JSONArray) jsonObject.get("item_use_flags");