diff --git a/game/src/ltn/auto.rs b/game/src/ltn/auto.rs index 574310337b..9c70173c0b 100644 --- a/game/src/ltn/auto.rs +++ b/game/src/ltn/auto.rs @@ -139,14 +139,14 @@ fn only_one_border(app: &mut App, neighborhood: &Neighborhood) { .modal_filters .roads .insert(road.id, 0.1 * road.length()); + break; } else if road.dst_i == *i { app.session .modal_filters .roads .insert(road.id, 0.9 * road.length()); + break; } - // Sometimes a cell has multiple roads connecing to the same border, so don't - // stop looking even once we add one filter } } } diff --git a/game/src/ltn/mod.rs b/game/src/ltn/mod.rs index a5280f66e9..8df0568b68 100644 --- a/game/src/ltn/mod.rs +++ b/game/src/ltn/mod.rs @@ -270,14 +270,17 @@ fn floodfill( }, ); for i in [current.src_i, current.dst_i] { + // It's possible for one border intersection to have two roads in the interior of the + // neighborhood. Don't consider a turn between those roads through this intersection as + // counting as connectivity -- we're right at the boundary road, so it's like leaving + // and re-entering the neighborhood. + if neighborhood_borders.contains(&i) { + cell_borders.insert(i); + continue; + } + for next in &map.get_i(i).roads { let next_road = map.get_r(*next); - if !perimeter.interior.contains(next) { - if neighborhood_borders.contains(&i) { - cell_borders.insert(i); - } - continue; - } if let Some(filter) = modal_filters.intersections.get(&i) { if !filter.allows_turn(current.id, *next) { continue;