From 9e531b0b8f86ba6748febe918f816580f0784230 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 14 Nov 2023 21:18:18 -0600 Subject: [PATCH] shape --- src/engine/gameManager/ZoneManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 000de7cc..43460b1e 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -440,10 +440,14 @@ public enum ZoneManager { for(Zone zone : getAllZones()){ for(PathingUtilities.Node node : zone.navNodes){ for(PathingUtilities.Node potentialNeighbor : zone.navNodes){ - for (Path2D.Float obstacle : zone.navObstacles) { - if (!node.equals(potentialNeighbor) && !obstacle.intersects(node.location.x, node.location.y, potentialNeighbor.location.x, potentialNeighbor.location.y)){ - node.neighbors.add(potentialNeighbor); + try { + for (Path2D.Float obstacle : zone.navObstacles) { + if (!node.equals(potentialNeighbor) && !obstacle.intersects(node.location.x, node.location.y, potentialNeighbor.location.x, potentialNeighbor.location.y)) { + node.neighbors.add(potentialNeighbor); + } } + } catch(Exception e){ + Logger.error("Failed To Check Neighbors Of Node In Zone: " + zone.getObjectUUID()); } } }