From 704375099bde777a972adfcd7f5a942b73b23291 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 24 Feb 2024 14:52:52 -0500 Subject: [PATCH] Wrapped in armor test --- src/engine/objects/ItemTemplate.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index a602eb23..12bfb4b7 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -139,13 +139,12 @@ public class ItemTemplate { item_parry_anim_id = ((Long) jsonObject.get("item_parry_anim_id")).intValue(); - // Item Type == ARMOR? + // Fields only present for ARMOR - if (jsonObject.containsValue("item_bulk_factor")) + if (item_type.equals(Enum.ItemType.ARMOR)) { item_bulk_factor = ((Double) jsonObject.get("item_bulk_factor")).floatValue(); - - if (jsonObject.containsValue("item_defense_rating")) item_defense_rating = ((Double) jsonObject.get("item_defense_rating")).floatValue(); + } JSONArray itemflags = (JSONArray) jsonObject.get("item_flags");