Skip to content

Commit

Permalink
fix: issues with InterSignalBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Aug 13, 2024
1 parent 68ebbeb commit 0affb94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public List<Map.Entry<Point, Point>> getNextPathways() {
public boolean addNextPathway(final Point start, final Point end) {
final Map.Entry<Point, Point> 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,4 +664,8 @@ public boolean isShuntingPath() {
public PathType getPathType() {
return data.getPathType();
}

public boolean isInterSignalBoxPathway() {
return this instanceof InterSignalBoxPathway;
}
}

0 comments on commit 0affb94

Please sign in to comment.