Browse Source

Duplicate range check removed.

feature-workorder
MagicBot 1 year ago
parent
commit
ae44a21be1
  1. 8
      src/engine/mobileAI/MobAI.java

8
src/engine/mobileAI/MobAI.java

@ -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);

Loading…
Cancel
Save