From 0c008322647af4363503899c8267ac582319e399 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 3 Jun 2024 21:46:16 -0500 Subject: [PATCH] attack delay catching --- src/engine/gameManager/CombatManager.java | 9 +-------- src/engine/net/client/handlers/AttackCmdMsgHandler.java | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 3b9749dd..ccc90008 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -126,13 +126,6 @@ public enum CombatManager { return; } - if (attacker.getTimers().containsKey("Attack" + slot)) { - AttackJob ajR = ((AttackJob)attacker.getTimers().get("Attack" + slot).getJob()); - if(ajR.target.equals(target)){ - return; - } - } - target.combatLock.writeLock().lock(); // check if character is in range to attack target @@ -229,7 +222,7 @@ public enum CombatManager { if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) ((Mob) attacker).nextAttackTime = System.currentTimeMillis() + delay; - + delay += addedDelay; if (inRange) { //handle retaliate diff --git a/src/engine/net/client/handlers/AttackCmdMsgHandler.java b/src/engine/net/client/handlers/AttackCmdMsgHandler.java index 27f25538..fb503532 100644 --- a/src/engine/net/client/handlers/AttackCmdMsgHandler.java +++ b/src/engine/net/client/handlers/AttackCmdMsgHandler.java @@ -91,6 +91,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob(); addedDelay = ajR.getStopTime() - System.currentTimeMillis(); } + }else{ + return true; } if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) { @@ -99,6 +101,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob(); addedDelay = ajL.getStopTime() - System.currentTimeMillis(); } + }else{ + return true; } CombatManager.combatCycle(playerCharacter, target, addedDelay);