This commit is contained in:
Azgaar 2020-04-08 23:35:32 +03:00
parent 6d0e106f1f
commit 5e9bd86069
2 changed files with 6 additions and 2 deletions

View file

@ -916,7 +916,9 @@
states.forEach(s => {
s.provinces = [];
if (!s.i || s.removed) return;
const stateBurgs = burgs.filter(b => b.state === s.i && !b.removed).sort((a, b) => b.population * gauss(1, .2, .5, 1.5, 3) - a.population);
const stateBurgs = burgs.filter(b => b.state === s.i && !b.removed)
.sort((a, b) => b.population * gauss(1, .2, .5, 1.5, 3) - a.population)
.sort((a, b) => b.capital - a.capital);
if (stateBurgs.length < 2) return; // at least 2 provinces are required
const provincesNumber = Math.max(Math.ceil(stateBurgs.length * percentage / 100), 2);
const form = Object.assign({}, forms[s.form]);