early exit for attack timer

This commit is contained in:
2024-05-26 20:31:22 -05:00
parent cbe9a30590
commit 69ea460d5e
@@ -546,6 +546,10 @@ public enum CombatManager {
public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) { public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) {
//calculate next allowed attack and update the timestamp //calculate next allowed attack and update the timestamp
if(attacker.getTimestamps().containsKey("Attack" + slot.name()) && attacker.getTimestamps().get("Attack" + slot.name()) > System.currentTimeMillis())
return;
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay); attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay);
//handle auto attack job creation //handle auto attack job creation