mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.1.11
This commit is contained in:
parent
481d7da4e6
commit
8ff1fe46b8
9 changed files with 31 additions and 28 deletions
|
|
@ -263,7 +263,7 @@ function editReligions() {
|
|||
});
|
||||
|
||||
function applyPopulationChange() {
|
||||
const ruralChange = rn(ruralPop.value / rural, 4);
|
||||
const ruralChange = ruralPop.value / rural;
|
||||
if (isFinite(ruralChange) && ruralChange !== 1) {
|
||||
const cells = pack.cells.i.filter(i => pack.cells.religion[i] === religion);
|
||||
cells.forEach(i => pack.cells.pop[i] *= ruralChange);
|
||||
|
|
@ -275,13 +275,13 @@ function editReligions() {
|
|||
cells.forEach(i => pack.cells.pop[i] = pop);
|
||||
}
|
||||
|
||||
const urbanChange = rn(urbanPop.value / urban, 4);
|
||||
const urbanChange = urbanPop.value / urban;
|
||||
if (isFinite(urbanChange) && urbanChange !== 1) {
|
||||
burgs.forEach(b => b.population *= urbanChange);
|
||||
burgs.forEach(b => b.population = rn(b.population * urbanChange, 4));
|
||||
}
|
||||
if (!isFinite(urbanChange) && +urbanPop.value > 0) {
|
||||
const points = urbanPop.value / populationRate.value / urbanization.value;
|
||||
const population = rn(points / burgs.length);
|
||||
const population = rn(points / burgs.length, 4);
|
||||
burgs.forEach(b => b.population = population);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue