Skip to content

Commit

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

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

0 comments on commit f8a85d8

Please sign in to comment.