Fix loading edits that change the number of lanes in a road. We need to compare the old version of the road in the edits with the basemap, NOT the edited version of the road. #597

This commit is contained in:
Dustin Carlino 2021-06-20 10:06:38 -07:00
parent d8cdfaba05
commit ae3d4e2363

View File

@ -95,12 +95,12 @@ impl PermanentEditCmd {
let num_current = map.get_r(id).lanes_ltr().len();
// The basemap changed -- it'd be pretty hard to understand the original
// intent of the edit.
if num_current != new.lanes_ltr.len() {
if num_current != old.lanes_ltr.len() {
bail!(
"number of lanes in {} is {} now, but {} in the edits",
r,
num_current,
new.lanes_ltr.len()
old.lanes_ltr.len()
);
}
Ok(EditCmd::ChangeRoad { r: id, new, old })