Don't let people filter one-way roads!

This commit is contained in:
Dustin Carlino 2022-05-17 16:15:34 +01:00
parent 078265718a
commit c84daeb239

View File

@ -231,8 +231,9 @@ pub fn handle_world_outcome(
match outcome {
WorldOutcome::ClickedObject(FilterableObj::InteriorRoad(r)) => {
let road = map.get_r(r);
// Filtering on a road that's already marked bike-only doesn't make sense
if !PathConstraints::Car.can_use_road(road, map) {
// Filtering a road that's already marked bike-only doesn't make sense. Likewise for
// one-ways.
if !PathConstraints::Car.can_use_road(road, map) || road.is_oneway() {
return true;
}