v1.5.8 - update river data on map load

This commit is contained in:
Azgaar 2021-03-01 02:26:56 +03:00
parent fbec08f982
commit 49b9895b0b
3 changed files with 21 additions and 4 deletions

View file

@ -1099,6 +1099,23 @@ function parseLoadedData(data) {
});
}
if (version < 1.59) {
// v 1.6 changed rivers data
for (const river of pack.rivers) {
const el = document.getElementById("river"+river.i);
if (el) {
el.removeAttribute("data-width");
el.removeAttribute("data-increment");
river.widthFactor = +this.getAttribute("data-width");
river.discharge = pack.cells.fl[river.mouth] || 1;
river.width = rn(river.length / 100, 2);
river.sourceWidth = .1;
} else {
Rivers.remove(river.i);
}
}
}
}()
void function checkDataIntegrity() {