From ab34931c3d63f48efe229d2c6e536f74fe1da553 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 4 Apr 2024 15:05:25 -0400 Subject: [PATCH] Test if value is enumset --- src/engine/objects/ItemTemplate.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 85fe32ed..f6e169ac 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -493,7 +493,12 @@ public class ItemTemplate { rune_dsc = (String) jsonObject.get("rune_dsc"); rune_fx_txt = (String) jsonObject.get("rune_fx_txt"); rune_group_tactics = ((Long) jsonObject.get("rune_group_tactics")).intValue(); - EnumSet tactics = Enum.fromLong(rune_group_tactics, Enum.MobBehaviourType.class); + + EnumSet tactics = EnumSet.noneOf(Enum.MobBehaviourType.class); + + if (rune_group_tactics != 0) + tactics.addAll(Enum.fromLong(rune_group_tactics, Enum.MobBehaviourType.class)); + rune_group_role_set = ((Long) jsonObject.get("rune_group_role_set")).intValue(); JSONArray enemy_types_json = (JSONArray) jsonObject.get("rune_enemy_monster_types");