From 82373f8cc8aa51267515b91b1c62b1a12c125127 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 1 Apr 2024 16:05:55 -0400 Subject: [PATCH] Proper parsing of power grants --- src/engine/objects/ItemTemplate.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index cd13104b..bf72c21e 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -350,15 +350,12 @@ public class ItemTemplate { item_user_power_action.put(power, arguments); } - JSONObject powerGrants = (JSONObject) jsonObject.get("item_power_grant"); + JSONArray powerGrants = (JSONArray) jsonObject.get("item_power_grant"); if (powerGrants.isEmpty() == false) { - JSONObject powerGrantEntries = (JSONObject) powerGrants.get("power_granted_powers"); - - for (Object grantedPower : powerGrantEntries.keySet()) { - int powerLevel = ((Long) powerGrantEntries.get(grantedPower)).intValue(); - item_power_grant.put((String) grantedPower, powerLevel); + for (Object grantedPower : powerGrants) { + JSONObject powerGrant = (JSONObject) grantedPower; } }