From ae44a21be1efe5702ea75df4e560bd03d849b884 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 7 Sep 2023 10:40:27 -0400 Subject: [PATCH] Duplicate range check removed. --- src/engine/mobileAI/MobAI.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 6543ce3a..f97cea37 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -889,13 +889,7 @@ public class MobAI { try { - float rangeSquared = mob.getRange() * mob.getRange(); - 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 (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (mob.getRange() > 15) { mob.destination = mob.getCombatTarget().getLoc(); MovementUtilities.moveToLocation(mob, mob.destination, 0);