From 6e123ecb8689bc253bf677d8872a7d44076484dd Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 17 May 2024 20:17:17 -0500 Subject: [PATCH] swing animation lookup --- src/engine/gameManager/CombatManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 86a1adb0..6a86933d 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -260,12 +260,16 @@ public enum CombatManager { if (target.getObjectType() == mbEnums.GameObjectType.Building) hitChance = 100; - int passiveAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD)); - if (attacker.charItemManager.getEquipped().get(slot) != null) { - passiveAnim = getSwingAnimation(weapon.template, null, true); + if(attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)){ + if (weapon != null) { + passiveAnim = getSwingAnimation(weapon.template, null, true); + } + }else { + if (attacker.charItemManager.getEquipped().get(slot) != null) { + passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true); + } } - if (ThreadLocalRandom.current().nextInt(100) > hitChance) { TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);