v1.5.57 - fix when pole is required for province without cells

This commit is contained in:
Azgaar 2021-02-25 00:18:45 +03:00
parent 4c4caa6ff7
commit 4560c5d05d
2 changed files with 5 additions and 5 deletions

View file

@ -316,7 +316,7 @@ function highlightEmblemElement(type, el) {
return;
}
const [x, y] = el.pole;
const [x, y] = el.pole || pack.cells.p[el.center];
const obj = type === "state" ? cells.state : cells.province;
const borderCells = cells.i.filter(id => obj[id] === i && cells.c[id].some(n => obj[n] !== i));
const data = Array.from(borderCells).filter((c, i) => !(i%2)).map(i => cells.p[i]).map(i => [i[0], i[1], Math.hypot(i[0]-x, i[1]-y)]);