diff --git a/src/main/java/net/Indyuce/mmocore/waypoint/Waypoint.java b/src/main/java/net/Indyuce/mmocore/waypoint/Waypoint.java index e8d2695f..7391f8a5 100644 --- a/src/main/java/net/Indyuce/mmocore/waypoint/Waypoint.java +++ b/src/main/java/net/Indyuce/mmocore/waypoint/Waypoint.java @@ -140,6 +140,10 @@ public class Waypoint extends PostLoadObject implements Unlockable { while (pointsToCheck.size() != 0) { WaypointPath checked = pointsToCheck.get(0); pointsToCheck.remove(0); + // If the point has already been checked, pass + if (checkedPoints.contains(checked.getFinalWaypoint())) + continue; + paths.add(checked); checkedPoints.add(checked.getFinalWaypoint()); @@ -165,6 +169,10 @@ public class Waypoint extends PostLoadObject implements Unlockable { while (pointsToCheck.size() != 0) { WaypointPath checked = pointsToCheck.get(0); pointsToCheck.remove(0); + // If the point has already been checked, pass + if (checkedPoints.contains(checked.getFinalWaypoint())) + continue; + paths.add(checked); checkedPoints.add(checked.getFinalWaypoint());