Browse Source

Proper parsing of power grants

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

10
src/engine/objects/ItemTemplate.java

@ -356,13 +356,11 @@ public class ItemTemplate {
for (Object grantArrayEntry : powerGrantsArray) { for (Object grantArrayEntry : powerGrantsArray) {
JSONObject powerGrantEntry = (JSONObject) grantArrayEntry; JSONObject powerGrantEntry = (JSONObject) grantArrayEntry;
JSONArray powerGrants = (JSONArray) powerGrantEntry.get("power_granted_powers"); String power_type = (String) powerGrantEntry.get("power_type");
int power_value = ((Long) powerGrantEntry.get("power_value")).intValue();
for (Object grantedPowerEntry : powerGrants) { item_power_grant.put(power_type, power_value);
JSONObject grantedPower = (JSONObject) grantedPowerEntry;
}
} }
} }
JSONArray item_power_actions = (JSONArray) jsonObject.get("item_power_action"); JSONArray item_power_actions = (JSONArray) jsonObject.get("item_power_action");

Loading…
Cancel
Save