From e128f605193b1c3d19bd2c617c9f64fb15959180 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 27 Oct 2023 23:16:08 -0500 Subject: [PATCH] cleanup --- src/engine/mobileAI/MobAI.java | 2 +- .../mobileAI/utilities/MovementUtilities.java | 15 ++++++--------- src/engine/objects/Building.java | 3 +++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index a0eb9f37..87b8b14b 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -584,7 +584,7 @@ public class MobAI { if(mob.isPlayerGuard() || mob.isSiege()) { bypassLoadedPlayerCheck = true; if(mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) - if(mob.combatTarget.loc.distanceSquared(mob.loc) > 10000) + if(mob.combatTarget.loc.distanceSquared(mob.loc) > 62500) mob.setCombatTarget(null); } diff --git a/src/engine/mobileAI/utilities/MovementUtilities.java b/src/engine/mobileAI/utilities/MovementUtilities.java index e95e6098..bd1a9f37 100644 --- a/src/engine/mobileAI/utilities/MovementUtilities.java +++ b/src/engine/mobileAI/utilities/MovementUtilities.java @@ -301,6 +301,8 @@ private static final int cellGap = 1; } public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){ try { + if(character.isMoving()) + return; if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building Building building = BuildingManager.getBuildingAtLocation(goal); @@ -393,14 +395,10 @@ private static final int cellGap = 1; if (path.contains(cheapCorner)) { continue; }else { - path.add(cheapCorner); - current = cheapCorner; - continue; + path.add(cheapCorner); + current = cheapCorner; + continue; } - - - if (path.contains(point)) - continue; } if (path.contains(point)) @@ -408,9 +406,8 @@ private static final int cellGap = 1; Regions region = Regions.getRegionAtLocation(point); if(region != null) { - path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions + path.add(new Vector3fImmutable(region.center)); //only use center points when travelling through regions continue; - } if (pointIsBlocked(point)) { diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index d65ccb22..b174d4b7 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -9,6 +9,7 @@ package engine.objects; +import com.sun.prism.Mesh; import engine.Enum; import engine.Enum.*; import engine.InterestManagement.RealmMap; @@ -1536,6 +1537,8 @@ public class Building extends AbstractWorldObject { } public void updateNavMesh(){ + + //TODO figure out how to subtract the mesh of the building form the navMesh for(Regions region : this.getBounds().getRegions()) this.parentZone.navMesh.add(region.getArea()); }