forked from MagicBane/Server
updated range chack and hitbox calculations
This commit is contained in:
@@ -150,11 +150,11 @@ public enum CombatManager {
|
|||||||
float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
||||||
|
|
||||||
boolean inRange = false;
|
boolean inRange = false;
|
||||||
//if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
// attackRange += ((PlayerCharacter) attacker).getCharacterHeight() * 0.5f;
|
attackRange += ((AbstractCharacter)target).calcHitBox();
|
||||||
//} else {
|
} else {
|
||||||
attackRange += attacker.calcHitBox();
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
if(attackRange > 15 && attacker.isMoving()){
|
if(attackRange > 15 && attacker.isMoving()){
|
||||||
//cannot shoot bow while moving;
|
//cannot shoot bow while moving;
|
||||||
|
|||||||
Reference in New Issue
Block a user