diff --git a/index.html b/index.html index 7117c6c0..493fe832 100644 --- a/index.html +++ b/index.html @@ -41,6 +41,15 @@ + + diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index dfb478fd..96765b8c 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -299,7 +299,7 @@ queue.queue({e:s.center, p:0, s:s.i, b}); cost[s.center] = 1; }); - const neutral = cells.i.length / 5000 * 2000 * neutralInput.value * statesNeutral.value; // limit cost for state growth + const neutral = cells.i.length / 5000 * 2500 * neutralInput.value * statesNeutral.value; // limit cost for state growth while (queue.length) { const next = queue.dequeue(), n = next.e, p = next.p, s = next.s, b = next.b; @@ -310,7 +310,7 @@ if (cells.state[e] && e === states[cells.state[e]].center) return; // do not overwrite capital cells const cultureCost = culture === cells.culture[e] ? -9 : 100; - const populationCost = cells.s[e] ? 20 - cells.s[e] : 2500; + const populationCost = cells.h[e] < 20 ? 0 : cells.s[e] ? Math.max(20 - cells.s[e], 0) : 5000; const biomeCost = getBiomeCost(b, cells.biome[e], type); const heightCost = getHeightCost(pack.features[cells.f[e]], cells.h[e], type); const riverCost = getRiverCost(cells.r[e], e, type); diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js index 5c66abbb..0c93d7f2 100644 --- a/modules/ui/heightmap-editor.js +++ b/modules/ui/heightmap-editor.js @@ -100,7 +100,7 @@ function editHeightmap() { if (tooltip.dataset.main) showMainTip(); // move radius circle if drag mode is active - const pressed = document.querySelector("#brushesButtons > button.pressed"); + const pressed = document.getElementById("brushesButtons").querySelector("button.pressed"); if (!pressed) return; moveCircle(p[0], p[1], brushRadius.valueAsNumber, "#333"); } @@ -151,7 +151,8 @@ function editHeightmap() { else if (mode === "risk") restoreRiskedData(); // restore initial layers - viewbox.select("#heights").remove(); + //viewbox.select("#heights").remove(); + document.getElementById("heights").remove(); turnButtonOff("toggleHeight"); document.getElementById("mapLayers").querySelectorAll("li").forEach(function(e) { if (editHeightmap.layers.includes(e.id) && !layerIsOn(e.id)) e.click(); // turn on