diff --git a/modules/ui/zones-editor.js b/modules/ui/zones-editor.js index f8811960..8e4ac3e4 100644 --- a/modules/ui/zones-editor.js +++ b/modules/ui/zones-editor.js @@ -360,7 +360,7 @@ function editZones() { function changePopulation(zone) { const dataCells = zones.select("#"+zone).attr("data-cells"); - const cells = dataCells ? dataCells.split(",").map(i => +i) : []; + const cells = dataCells ? dataCells.split(",").map(i => +i).filter(i => pack.cells.pop[i]) : []; if (!cells.length) {tip("Zone does not have any cells, cannot change population", false, "error"); return;} const burgs = pack.burgs.filter(b => !b.removed && cells.includes(b.cell));