Browse Source

Parsing cleanup

combat-2
MagicBot 9 months ago
parent
commit
a99b0072e0
  1. 10
      src/engine/objects/ItemTemplate.java

10
src/engine/objects/ItemTemplate.java

@ -153,14 +153,14 @@ public class ItemTemplate {
item_initial_charges = ((Long) jsonObject.get("item_initial_charges")).intValue(); item_initial_charges = ((Long) jsonObject.get("item_initial_charges")).intValue();
JSONObject skill_required = (JSONObject) jsonObject.get("item_skill_req"); JSONArray skill_required = (JSONArray) jsonObject.get("item_skill_req");
if (skill_required.isEmpty() == false) { for (Object o : skill_required) {
JSONObject skill_req = (JSONObject) o;
String skill_type = (String) skill_required.get("skill_type"); String skill_type = (String) skill_req.get("skill_type");
skill_type = skill_type.replaceAll("\\s", ""); skill_type = skill_type.replaceAll("\\s", "");
skill_type = skill_type.replaceAll(",", ""); skill_type = skill_type.replaceAll(",", "");
int skill_level = ((Long) skill_required.get("skill_level")).intValue(); int skill_level = ((Long) skill_req.get("skill_level")).intValue();
item_skill_required.put(Enum.CharacterSkills.valueOf(skill_type), skill_level); item_skill_required.put(Enum.CharacterSkills.valueOf(skill_type), skill_level);
} }

Loading…
Cancel
Save