mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 01:13:53 +03:00
Allow editing service roads that're bus-only. User reported an example in Tehran
This commit is contained in:
parent
4ddfe66afd
commit
5d93671ae3
@ -741,7 +741,16 @@ pub fn apply_map_edits(ctx: &mut EventCtx, app: &mut App, edits: MapEdits) {
|
||||
|
||||
pub fn can_edit_lane(app: &App, l: LaneID) -> bool {
|
||||
let map = &app.primary.map;
|
||||
!map.get_l(l).is_light_rail() && !map.get_parent(l).is_service()
|
||||
if map.get_l(l).is_light_rail() {
|
||||
return false;
|
||||
}
|
||||
let r = map.get_parent(l);
|
||||
// Some bus-only roads are marked as service roads; allow editing those.
|
||||
if r.is_service() && r.lanes.iter().all(|l| !l.is_bus()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
pub fn speed_limit_choices(app: &App, preset: Option<Speed>) -> Vec<Choice<Speed>> {
|
||||
|
Loading…
Reference in New Issue
Block a user