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.
This commit is contained in:
Avi Weinstock 2021-09-14 15:33:08 -04:00
parent 6a3d1858d3
commit 4039ce65f1

View file

@ -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) {
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) {