From 46f3850e93a3928d39321943980e5e2e9b620db8 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 4 Apr 2024 15:16:11 -0400 Subject: [PATCH] Values parsed as behaviourtype enumset --- src/engine/objects/ItemTemplate.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index f6e169ac..84bbdb33 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -121,8 +121,10 @@ public class ItemTemplate { public boolean rune_group_is_guild = false; public String rune_dsc; public String rune_fx_txt; - public int rune_group_tactics; - public int rune_group_role_set; + public EnumSet rune_group_tactics = EnumSet.noneOf(Enum.MobBehaviourType.class); + ; + public EnumSet rune_group_role_set = EnumSet.noneOf(Enum.MobBehaviourType.class); + ; public boolean rune_renderable = false; public int rune_natural_power_attack; public final HashMap rune_sparse_data = new HashMap<>(); @@ -492,14 +494,12 @@ public class ItemTemplate { rune_group_is_guild = ((Boolean) rune_group.get("group_is_guild")); 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 = EnumSet.noneOf(Enum.MobBehaviourType.class); + int group_tactics_bitvector = ((Long) jsonObject.get("rune_group_tactics")).intValue(); + rune_group_tactics.addAll(Enum.fromLong(group_tactics_bitvector, 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(); + int group_role_bitvector = ((Long) jsonObject.get("rune_group_role_set")).intValue(); + rune_group_role_set.addAll(Enum.fromLong(group_role_bitvector, Enum.MobBehaviourType.class)); JSONArray enemy_types_json = (JSONArray) jsonObject.get("rune_enemy_monster_types");