From 22c8cdcf6562bb2b4e1fcd5785910a765a53ed40 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 26 May 2024 22:00:52 -0500 Subject: [PATCH] fixed pet attack and null weapon combat issue --- src/engine/gameManager/CombatManager.java | 19 +++++++++---------- .../client/handlers/PetAttackMsgHandler.java | 3 --- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index a217775d..abda3780 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -225,22 +225,21 @@ public enum CombatManager { } } - - //check if Out of Stamina - if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) { - if (attacker.getStamina() < (weapon.template.item_wt / 3f)) { - //set auto attack job - setAutoAttackJob(attacker, slot, delay); - return; - } - } // take stamina away from attacker if (weapon != null) { + //check if Out of Stamina + if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) { + if (attacker.getStamina() < (weapon.template.item_wt / 3f)) { + //set auto attack job + setAutoAttackJob(attacker, slot, delay); + return; + } + } float stam = weapon.template.item_wt / 3f; stam = (stam < 1) ? 1 : stam; attacker.modifyStamina(-(stam), attacker, true); } else - attacker.modifyStamina(-0.5f, attacker, true); + attacker.modifyStamina(1, attacker, true); //cancel things that are cancelled by an attack diff --git a/src/engine/net/client/handlers/PetAttackMsgHandler.java b/src/engine/net/client/handlers/PetAttackMsgHandler.java index e6aff796..34d65730 100644 --- a/src/engine/net/client/handlers/PetAttackMsgHandler.java +++ b/src/engine/net/client/handlers/PetAttackMsgHandler.java @@ -46,9 +46,6 @@ public class PetAttackMsgHandler extends AbstractClientMsgHandler { if (!pet.isAlive()) return true; - if (pet.getCombatTarget() == null) - return true; - if ((playerCharacter.inSafeZone()) && (msg.getTargetType() == mbEnums.GameObjectType.PlayerCharacter.ordinal())) return true;