FIX: keep original burg population after submapping

This commit is contained in:
Mészáros Gergely 2022-05-07 18:00:12 +02:00
parent 5a35f0d320
commit bd21aa6d8e
2 changed files with 3 additions and 1 deletions

View file

@ -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)) {

View file

@ -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