fix: adding a capital for neutrals

This commit is contained in:
Azgaar 2024-03-16 13:10:49 +01:00
parent 5803f44b99
commit 72b6314d34
3 changed files with 5 additions and 3 deletions

View file

@ -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;