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

@ -2,7 +2,7 @@
// https://github.com/Azgaar/Fantasy-Map-Generator // https://github.com/Azgaar/Fantasy-Map-Generator
"use strict"; "use strict";
const version = "1.5"; // generator version const version = "1.59"; // generator version
document.title += " v" + version; document.title += " v" + version;
// Switches to disable/enable logging features // Switches to disable/enable logging features

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() { void function checkDataIntegrity() {