v1.5.53 - fix for active provinces linked to removed state

This commit is contained in:
Azgaar 2021-02-24 14:26:41 +03:00
parent d3fe1899b3
commit c2edda6a4a
2 changed files with 12 additions and 1 deletions

View file

@ -209,7 +209,11 @@
} }
const generate = function(parent, kinship, dominion, type) { const generate = function(parent, kinship, dominion, type) {
if (parent === "custom") parent = null; if (!parent || parent === "custom") {
parent = null;
kinship = 0;
dominion = 0;
}
let usedPattern = null, usedTinctures = []; let usedPattern = null, usedTinctures = [];
const t1 = P(kinship) ? parent.t1 : getTincture("field"); const t1 = P(kinship) ? parent.t1 : getTincture("field");

View file

@ -1144,6 +1144,13 @@ function parseLoadedData(data) {
cells.i.filter(i => cells.burg[i] === b.i).forEach(i => cells.burg[i] = 0); cells.i.filter(i => cells.burg[i] === b.i).forEach(i => cells.burg[i] = 0);
cells.burg[b.cell] = b.i; cells.burg[b.cell] = b.i;
}); });
pack.provinces.forEach(p => {
if (!p.i || p.removed) return;
if (pack.states[p.state] && !pack.states[p.state].removed) return;
ERROR && console.error("Data Integrity Check. Province", p.i, "is linked to removed state", p.state);
p.removed = true; // remove incorrect province
});
}() }()
changeMapSize(); changeMapSize();