early exit for attack timer

This commit is contained in:
2024-05-26 21:41:59 -05:00
parent 69ea460d5e
commit 232c381e96
2 changed files with 9 additions and 12 deletions
+9 -6
View File
@@ -118,12 +118,15 @@ public enum CombatManager {
if (!attacker.isCombat())
return;
if (attacker.getTimestamps().get("Attack" + slot.name()) != null && attacker.getTimestamps().get("Attack" + slot.name()) < System.currentTimeMillis()) {
setAutoAttackJob(attacker, slot, 1000);
return;
}
//check if this slot is on attack timer, if timer has passed clear it, else early exit
if(attacker.getTimers().containsKey("Attack"+slot.name()))
if(attacker.getTimers().get("Attack"+slot.name()).timeToExecutionLeft() <= 0)
attacker.getTimers().remove("Attack"+slot.name());
else
return;
}
// check if character is in range to attack target
PlayerBonuses bonus = attacker.getBonuses();
@@ -285,8 +288,8 @@ public enum CombatManager {
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
else
DispatchManager.sendToAllInRange(attacker, msg);
//else
// DispatchManager.sendToAllInRange(attacker, msg);
//set auto attack job
setAutoAttackJob(attacker, slot, delay);