From 8369ba73e56eb2c5369aebd0e5dfdfbbcb670718 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Tue, 14 Sep 2021 15:33:08 -0400 Subject: [PATCH] Explicitly set the combat style from the NPC config instead of assuming the default is melee. Previously, TDs would just keep their previous style when switching to a state that had melee defined. --- Server/src/main/java/core/game/node/entity/npc/NPC.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/src/main/java/core/game/node/entity/npc/NPC.java b/Server/src/main/java/core/game/node/entity/npc/NPC.java index 4fcdcf23d..6bb1b1add 100644 --- a/Server/src/main/java/core/game/node/entity/npc/NPC.java +++ b/Server/src/main/java/core/game/node/entity/npc/NPC.java @@ -628,10 +628,10 @@ public class NPC extends Entity { } getProperties().setAttackStyle(new WeaponInterface.AttackStyle(WeaponInterface.STYLE_CONTROLLED, index)); CombatStyle style = getDefinition().getConfiguration(NPCConfigParser.COMBAT_STYLE); - if (style == CombatStyle.RANGE) { - getProperties().getCombatPulse().setStyle(style); - } else if (style == CombatStyle.MAGIC) { - getProperties().getCombatPulse().setStyle(style); + if (style != null) { + getProperties().getCombatPulse().setStyle(style); + } + if (style == CombatStyle.MAGIC) { getProperties().setAutocastSpell(new DefaultCombatSpell(this)); int spell = definition.getConfiguration("spell_id", -1); if (spell != -1) {