From f7d820c9767793446a9def8ad7d58ef9312ffee5 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 28 Sep 2019 20:39:19 +0300 Subject: [PATCH] v1.1.05 --- modules/ui/zones-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ui/zones-editor.js b/modules/ui/zones-editor.js index 8e4ac3e4..a38d13b2 100644 --- a/modules/ui/zones-editor.js +++ b/modules/ui/zones-editor.js @@ -360,8 +360,8 @@ function editZones() { function changePopulation(zone) { const dataCells = zones.select("#"+zone).attr("data-cells"); - 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 cells = dataCells ? dataCells.split(",").map(i => +i).filter(i => pack.cells.h[i] >= 20) : []; + if (!cells.length) {tip("Zone does not have any land cells, cannot change population", false, "error"); return;} const burgs = pack.burgs.filter(b => !b.removed && cells.includes(b.cell)); const rural = rn(d3.sum(cells.map(i => pack.cells.pop[i])) * populationRate.value);