From 90874b01a774db6883d9eaa025eb2fc9347c4e00 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Feb 2024 12:26:11 -0500 Subject: [PATCH] Fleshing out constructor --- src/engine/objects/ItemTemplate.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 1e41d3c7..4358d6c0 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -36,7 +36,13 @@ public class ItemTemplate { obj_render_object = ((Long) jsonObject.get("obj_render_object")).intValue(); - combat_attack_resist = (HashMap) jsonObject.get("combat_attack_resist"); + JSONObject resist_json = (JSONObject) jsonObject.get("combat_attack_resist"); + + for (Object key : resist_json.keySet()) { + Float resist = (Float) resist_json.get((String) key); + combat_attack_resist.put((String) key, resist); + } + }