diff --git a/index.html b/index.html index ae7345ee..621428ac 100644 --- a/index.html +++ b/index.html @@ -7902,7 +7902,7 @@ - + diff --git a/modules/io/load.js b/modules/io/load.js index ea2ff63d..a4ff11ea 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -439,7 +439,7 @@ async function parseLoadedData(data) { const cells = pack.cells; if (pack.cells.i.length !== pack.cells.state.length) { - const message = "Data Integrity Check. Striping issue. To fix edit the heightmap in erase mode"; + const message = "Data Integrity Check. Striping issue detected. To fix edit the heightmap in erase mode"; ERROR && console.error(message); } @@ -482,11 +482,13 @@ async function parseLoadedData(data) { ERROR && console.error("Data Integrity Check. Invalid feature", f, "is assigned to cells", invalidCells); }); - const invalidBurgs = [...new Set(cells.burg)].filter(b => b && (!pack.burgs[b] || pack.burgs[b].removed)); - invalidBurgs.forEach(b => { - const invalidCells = cells.i.filter(i => cells.burg[i] === b); + const invalidBurgs = [...new Set(cells.burg)].filter( + burgId => burgId && (!pack.burgs[burgId] || pack.burgs[burgId].removed) + ); + invalidBurgs.forEach(burgId => { + const invalidCells = cells.i.filter(i => cells.burg[i] === burgId); invalidCells.forEach(i => (cells.burg[i] = 0)); - ERROR && console.error("Data Integrity Check. Invalid burg", b, "is assigned to cells", invalidCells); + ERROR && console.error("Data Integrity Check. Invalid burg", burgId, "is assigned to cells", invalidCells); }); const invalidRivers = [...new Set(cells.r)].filter(r => r && !pack.rivers.find(river => river.i === r)); @@ -524,6 +526,11 @@ async function parseLoadedData(data) { burg.state = 0; } + if (burg.state && pack.states[burg.state].removed) { + ERROR && console.error("Data Integrity Check. Burg", burg.i, "is linked to removed state", burg.state); + burg.state = 0; + } + if (burg.state === undefined) { ERROR && console.error("Data Integrity Check. Burg", burg.i, "has no state data"); burg.state = 0; diff --git a/versioning.js b/versioning.js index 6dac46df..9467d1b5 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.88.00"; // generator version, update each time +const version = "1.88.01"; // generator version, update each time { document.title += " v" + version;