From bd21aa6d8ead310811dab09eaa09e80feb021b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Sat, 7 May 2022 18:00:12 +0200 Subject: [PATCH 1/2] FIX: keep original burg population after submapping --- modules/submap.js | 1 + modules/ui/submap.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/submap.js b/modules/submap.js index 6ec6d2e9..dde13a19 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -367,6 +367,7 @@ window.Submap = (function () { pack.burgs.forEach((b, id) => { if (id == 0) return; // skip empty city of neturals [b.x, b.y] = projection(b.x, b.y); + b.population = b.population * options.scale; // adjust for populationRate change // disable out-of-map (removed) burgs if (!inMap(b.x, b.y)) { diff --git a/modules/ui/submap.js b/modules/ui/submap.js index a2fae5f7..1ed9847b 100644 --- a/modules/ui/submap.js +++ b/modules/ui/submap.js @@ -120,7 +120,8 @@ window.UISubmap = (function () { rescaleStyles: checked("submapRescaleStyles"), smoothHeightMap: scale > 2, inverse: (x, y) => [x / origScale + x0, y / origScale + y0], - projection: (x, y) => [(x - x0) * origScale, (y - y0) * origScale] + projection: (x, y) => [(x - x0) * origScale, (y - y0) * origScale], + scale: origScale, }; // converting map position on the planet From f53d5810d586f2cb7696e4eca143e7caf73d038e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Sat, 7 May 2022 18:43:47 +0200 Subject: [PATCH 2/2] FIX: avoid redirect at watabou --- modules/ui/editors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/editors.js b/modules/ui/editors.js index 819a2637..e3cd8668 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -320,7 +320,7 @@ function getMFCGlink(burg) { } const parameters = {name, population, size, seed, river, coast, farms, citadel, urban_castle, hub, plaza, temple, walls, shantytown, gates: -1}; - const url = new URL("https://watabou.github.io/city-generator"); + const url = new URL("https://watabou.github.io/city-generator/"); url.search = new URLSearchParams(parameters); if (sea) url.searchParams.append("sea", sea);