From 72b6314d34831740f4623b417d2429f06b8d4b9c Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 16 Mar 2024 13:10:49 +0100 Subject: [PATCH] fix: adding a capital for neutrals --- index.html | 2 +- modules/io/load.js | 4 +++- versioning.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index f9b54ef9..725a0e3a 100644 --- a/index.html +++ b/index.html @@ -8093,7 +8093,7 @@ - + diff --git a/modules/io/load.js b/modules/io/load.js index d07679d4..c038eb5c 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -539,6 +539,8 @@ async function parseLoadedData(data, mapVersion) { }); pack.burgs.forEach(burg => { + if (typeof burg.capital === "boolean") burg.capital = Number(burg.capital); + if (!burg.i && burg.lock) { ERROR && console.error(`Data integrity check. Burg 0 is marked as locked, removing the status`); delete burg.lock; @@ -627,7 +629,7 @@ async function parseLoadedData(data, mapVersion) { return; } - if (stateBurgs.length && !capitalBurgs.length) { + if (state.i && stateBurgs.length && !capitalBurgs.length) { ERROR && console.error(`Data integrity check. State ${state.i} has no capital. Assigning the first burg as capital`); stateBurgs[0].capital = 1; diff --git a/versioning.js b/versioning.js index 0c547679..0eea1e86 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.97.01"; // generator version, update each time +const version = "1.97.02"; // generator version, update each time { document.title += " v" + version;