|
|
@ -889,13 +889,7 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
float rangeSquared = mob.getRange() * mob.getRange(); |
|
|
|
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { |
|
|
|
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mob.isMoving() == true && distanceSquared < rangeSquared - 50) { |
|
|
|
|
|
|
|
mob.destination = mob.getLoc(); |
|
|
|
|
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, 0); |
|
|
|
|
|
|
|
} else if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { |
|
|
|
|
|
|
|
if (mob.getRange() > 15) { |
|
|
|
if (mob.getRange() > 15) { |
|
|
|
mob.destination = mob.getCombatTarget().getLoc(); |
|
|
|
mob.destination = mob.getCombatTarget().getLoc(); |
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, 0); |
|
|
|
MovementUtilities.moveToLocation(mob, mob.destination, 0); |
|
|
|