mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 18:41:23 +01:00
fix: redraw population on change
This commit is contained in:
parent
cf5e75b561
commit
8907cd62ec
6 changed files with 8 additions and 0 deletions
|
|
@ -135,6 +135,7 @@ function regenerateRivers() {
|
|||
|
||||
function recalculatePopulation() {
|
||||
rankCells();
|
||||
|
||||
pack.burgs.forEach(b => {
|
||||
if (!b.i || b.removed || b.lock) return;
|
||||
const i = b.cell;
|
||||
|
|
@ -144,6 +145,8 @@ function recalculatePopulation() {
|
|||
if (b.port) b.population = b.population * 1.3; // increase port population
|
||||
b.population = rn(b.population * gauss(2, 3, 0.6, 20, 3), 3);
|
||||
});
|
||||
|
||||
if (layerIsOn("togglePopulation")) drawPopulation();
|
||||
}
|
||||
|
||||
function regenerateStates() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue