diff --git a/index.html b/index.html
index c6c9915b..f4472f74 100644
--- a/index.html
+++ b/index.html
@@ -7849,7 +7849,7 @@
-
+
@@ -7865,7 +7865,7 @@
-
+
@@ -7903,7 +7903,7 @@
-
+
diff --git a/modules/io/load.js b/modules/io/load.js
index a4ff11ea..cd1ed8c0 100644
--- a/modules/io/load.js
+++ b/modules/io/load.js
@@ -500,6 +500,15 @@ async function parseLoadedData(data) {
});
pack.burgs.forEach(burg => {
+ if ((!burg.i || burg.removed) && burg.lock) {
+ ERROR &&
+ console.error(
+ `Data Integrity Check. Burg ${burg.i || "0"} is removed or invalid but still locked. Unlocking the burg`
+ );
+ delete burg.lock;
+ return;
+ }
+
if (!burg.i || burg.removed) return;
if (burg.cell === undefined || burg.x === undefined || burg.y === undefined) {
ERROR &&
diff --git a/modules/submap.js b/modules/submap.js
index 85408487..41cdf74b 100644
--- a/modules/submap.js
+++ b/modules/submap.js
@@ -403,7 +403,7 @@ window.Submap = (function () {
} else {
b.cell = cityCell;
}
- if (!b.lock) b.lock = options.lockBurgs;
+ if (b.i && !b.lock) b.lock = options.lockBurgs;
cells.burg[b.cell] = id;
});
}
diff --git a/modules/ui/tools.js b/modules/ui/tools.js
index 0c0b9130..b4a6e162 100644
--- a/modules/ui/tools.js
+++ b/modules/ui/tools.js
@@ -261,7 +261,7 @@ function regenerateProvinces() {
function regenerateBurgs() {
const {cells, states} = pack;
- const lockedburgs = pack.burgs.filter(b => b.lock);
+ const lockedburgs = pack.burgs.filter(b => b.i && !b.removed && b.lock);
rankCells();
cells.burg = new Uint16Array(cells.i.length);
diff --git a/versioning.js b/versioning.js
index 6dbf5bbf..959a3fa8 100644
--- a/versioning.js
+++ b/versioning.js
@@ -1,7 +1,7 @@
"use strict";
// version and caching control
-const version = "1.88.04"; // generator version, update each time
+const version = "1.88.05"; // generator version, update each time
{
document.title += " v" + version;