From 8aeccd35c9b2ba3b2873d11fed2995b88583c258 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 13 Jan 2025 15:57:01 -0600 Subject: [PATCH] mob drop aggro check --- src/engine/mobileAI/utilities/MovementUtilities.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/mobileAI/utilities/MovementUtilities.java b/src/engine/mobileAI/utilities/MovementUtilities.java index 85affdca..d2fa2d4b 100644 --- a/src/engine/mobileAI/utilities/MovementUtilities.java +++ b/src/engine/mobileAI/utilities/MovementUtilities.java @@ -103,15 +103,19 @@ public class MovementUtilities { Vector3fImmutable sl = agent.getLoc(); Vector3fImmutable tl = target.getLoc(); - float distanceSquaredToTarget = sl.distanceSquared2D(tl) - sqr(agent.calcHitBox() + target.calcHitBox()); //distance to center of target - + float disSq = sl.distanceSquared(tl); float range = agent.getRange() + 150; + + //float distanceSquaredToTarget = sl.distanceSquared2D(tl) - sqr(agent.calcHitBox() + target.calcHitBox()); //distance to center of target + + + if (range > 200) range = 200; - return distanceSquaredToTarget < sqr(range); + return disSq > (range * range); }