diff --git a/src/engine/mobileAI/utilities/CombatUtilities.java b/src/engine/mobileAI/utilities/CombatUtilities.java index 0ee24bb7..ad0a5fce 100644 --- a/src/engine/mobileAI/utilities/CombatUtilities.java +++ b/src/engine/mobileAI/utilities/CombatUtilities.java @@ -201,6 +201,8 @@ public class CombatUtilities { public static void combatCycle(Mob agent, AbstractWorldObject target, boolean mainHand, ItemBase wb) { + ItemTemplate template = ItemTemplate.templates.get(wb.getUUID()); + if (!agent.isAlive() || !target.isAlive()) return; @@ -221,7 +223,7 @@ public class CombatUtilities { if (agent.isSiege()) dt = SourceType.SIEGE; if (wb != null) { - anim = CombatManager.getSwingAnimation(wb, null, mainHand); + anim = CombatManager.getSwingAnimation(template, null, mainHand); dt = wb.getDamageType(); } else if (!mainHand) return; @@ -250,7 +252,8 @@ public class CombatUtilities { if (res != null && (res.immuneToAll() || res.immuneToAttacks() || res.immuneTo(dt))) return; - int passiveAnim = CombatManager.getSwingAnimation(wb, null, mainHand); + int passiveAnim = CombatManager.getSwingAnimation(template, null, mainHand); + if (canSwing(agent)) { if (triggerDefense(agent, target)) { swingIsMiss(agent, target, passiveAnim);