forked from MagicBane/Server
mele / player location sync
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user