mele / player location sync

This commit is contained in:
2025-03-11 19:39:04 -05:00
parent 011ceea598
commit 32563e3f5f
2 changed files with 24 additions and 7 deletions
+12
View File
@@ -481,6 +481,18 @@ public enum CombatManager {
}
}
float attackerHitBox = abstractCharacter.calcHitBox();
float targetHitBox = 0.0f;
if(AbstractCharacter.IsAbstractCharacter(target)){
AbstractCharacter targetCharacter = (AbstractCharacter)target;
targetHitBox = targetCharacter.calcHitBox();
}else if(target.getObjectType().equals(GameObjectType.Building)){
Building targetBuilding = (Building)target;
targetHitBox = targetBuilding.getBounds().getHalfExtents().x;
}
range += attackerHitBox + targetHitBox;
if (NotInRange(abstractCharacter, target, range)) {
//target is in stealth and can't be seen by source