diff --git a/src/main/java/com/troblecodings/signals/enums/PathwayRequestResult.java b/src/main/java/com/troblecodings/signals/enums/PathwayRequestResult.java index 9399788b3..43a7f8654 100644 --- a/src/main/java/com/troblecodings/signals/enums/PathwayRequestResult.java +++ b/src/main/java/com/troblecodings/signals/enums/PathwayRequestResult.java @@ -34,8 +34,7 @@ public PathwayData getPathwayData() { } public boolean canBeAddedToSaver() { - return this == ALREADY_USED || this == NO_PATH - || !(data != null && !data.isInterSignalBoxPathway()); + return this == ALREADY_USED || this == NO_PATH; } public boolean isPass() { diff --git a/src/main/java/com/troblecodings/signals/signalbox/SignalBoxGrid.java b/src/main/java/com/troblecodings/signals/signalbox/SignalBoxGrid.java index 0dc42103a..45931c582 100644 --- a/src/main/java/com/troblecodings/signals/signalbox/SignalBoxGrid.java +++ b/src/main/java/com/troblecodings/signals/signalbox/SignalBoxGrid.java @@ -311,6 +311,10 @@ public List> getNextPathways() { public boolean addNextPathway(final Point start, final Point end) { final Map.Entry entry = Maps.immutableEntry(start, end); if (!nextPathways.contains(entry)) { + final SignalBoxPathway pw = startsToPath.get(start); + if (pw != null && pw.isInterSignalBoxPathway()) { + return false; + } if (executingForEach) { toAdd.add(entry); } else { diff --git a/src/main/java/com/troblecodings/signals/signalbox/SignalBoxPathway.java b/src/main/java/com/troblecodings/signals/signalbox/SignalBoxPathway.java index 2c6907f4a..117a216df 100644 --- a/src/main/java/com/troblecodings/signals/signalbox/SignalBoxPathway.java +++ b/src/main/java/com/troblecodings/signals/signalbox/SignalBoxPathway.java @@ -664,4 +664,8 @@ public boolean isShuntingPath() { public PathType getPathType() { return data.getPathType(); } + + public boolean isInterSignalBoxPathway() { + return this instanceof InterSignalBoxPathway; + } } \ No newline at end of file