Skip to content

Commit

Permalink
core: check offset when checking constraints in infra explorer for en…
Browse files Browse the repository at this point in the history
…d location

Signed-off-by: Erashin <[email protected]>
  • Loading branch information
Erashin committed Oct 11, 2024
1 parent f8a85d8 commit 5a3a304
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,16 @@ private class InfraExplorerImpl(
nBlocksToSkip++
} else {
// If a block cannot be explored, give up
val endLocation = stops.last().firstOrNull { it.edge == block }
val isRouteBlocked =
constraints.any { constraint ->
constraint.apply(block).any {
if (firstLocation != null)
if (firstLocation != null && firstLocation.edge == block)
firstLocation.offset.distance >= it.start.distance &&
firstLocation.offset.distance < it.end.distance
else if (endLocation != null)
endLocation.offset.distance >= it.start.distance &&
endLocation.offset.distance < it.end.distance
else true
}
}
Expand Down

0 comments on commit 5a3a304

Please sign in to comment.