FIX: incorrect province copy and minor fix of rebels

This commit is contained in:
Mészáros Gergely 2021-09-14 22:13:50 +02:00
parent 006ab7f329
commit 2b1dd01a1e
2 changed files with 2 additions and 1 deletions

View file

@ -1695,6 +1695,7 @@ function addZones(number = 1) {
if (!state) return; if (!state) return;
const neib = ra(state.neighbors.filter(n => n && !states[n].removed)); const neib = ra(state.neighbors.filter(n => n && !states[n].removed));
if (!neib) return;
const cell = cells.i.find(i => cells.state[i] === state.i && !state.removed && cells.c[i].some(c => cells.state[c] === neib)); const cell = cells.i.find(i => cells.state[i] === state.i && !state.removed && cells.c[i].some(c => cells.state[c] === neib));
const cellsArray = [], const cellsArray = [],
queue = [], queue = [],

View file

@ -248,7 +248,7 @@ window.Submap = (function () {
const validProvinces = new Set(pack.cells.province); const validProvinces = new Set(pack.cells.province);
pack.provinces = parentMap.pack.provinces; pack.provinces = parentMap.pack.provinces;
// mark uneccesary provinces // mark uneccesary provinces
pack.states.forEach((s, i) => { pack.provinces.forEach((s, i) => {
if (s.removed) return; if (s.removed) return;
if (!validProvinces.has(i)) s.removed = true; if (!validProvinces.has(i)) s.removed = true;
}); });