From 0096b8051c591eae8c74c97102093fbd78dc7801 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 27 May 2024 19:59:35 -0500 Subject: [PATCH] updated range chack and hitbox calculations --- src/engine/gameManager/CombatManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index b1b3b66a..099b31d4 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -150,11 +150,11 @@ public enum CombatManager { float distanceSquared = attacker.loc.distanceSquared(target.loc); boolean inRange = false; - //if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) { - // attackRange += ((PlayerCharacter) attacker).getCharacterHeight() * 0.5f; - //} else { - attackRange += attacker.calcHitBox(); - //} + if (AbstractCharacter.IsAbstractCharacter(target)) { + attackRange += ((AbstractCharacter)target).calcHitBox(); + } else { + + } if(attackRange > 15 && attacker.isMoving()){ //cannot shoot bow while moving;