From cc02be95f30c8616e6fd1f05387acab8abd665d8 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 1 Apr 2024 16:32:17 -0400 Subject: [PATCH] Proper parsing of power grants --- src/engine/objects/ItemTemplate.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index cfaaca86..5d5cb754 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -356,13 +356,11 @@ public class ItemTemplate { for (Object grantArrayEntry : powerGrantsArray) { JSONObject powerGrantEntry = (JSONObject) grantArrayEntry; - JSONArray powerGrants = (JSONArray) powerGrantEntry.get("power_granted_powers"); - - for (Object grantedPowerEntry : powerGrants) { - JSONObject grantedPower = (JSONObject) grantedPowerEntry; - - } + String power_type = (String) powerGrantEntry.get("power_type"); + int power_value = ((Long) powerGrantEntry.get("power_value")).intValue(); + item_power_grant.put(power_type, power_value); } + } JSONArray item_power_actions = (JSONArray) jsonObject.get("item_power_action");