This commit is contained in:
Azgaar 2020-03-30 23:10:33 +03:00
parent aae37eb702
commit 29117db1cf
8 changed files with 45 additions and 58 deletions

View file

@ -172,9 +172,10 @@ function removeBurg(id) {
if (label) label.remove();
if (icon) icon.remove();
if (anchor) anchor.remove();
pack.burgs[id].removed = true;
const cell = pack.burgs[id].cell;
pack.cells.burg[cell] = 0;
const cells = pack.cells, burg = pack.burgs[id];
burg.removed = true;
cells.burg[burg.cell] = 0;
}
function toggleCapital(burg) {

View file

@ -105,7 +105,7 @@ function overviewMilitary() {
const population = rn((s.rural + s.urban * urbanization.value) * populationRate.value);
const total = line.dataset.total = options.military.reduce((s, u) => s + getForces(u) * u.crew, 0);
const rate = line.dataset.rate = total / population * 100;
line.querySelector("div[data-type='total']>b").innerHTML = si(total);
line.querySelector("div[data-type='total']").innerHTML = si(total);
line.querySelector("div[data-type='rate']").innerHTML = rn(rate, 2) + "%";
updateFooter();

View file

@ -136,6 +136,7 @@ function regenerateBurgs() {
moveBurgToGroup(burg, "cities");
});
pack.features.forEach(f => {if (f.port) f.port = 0}); // reset features ports counter
BurgsAndStates.specifyBurgs();
BurgsAndStates.defineBurgFeatures();
BurgsAndStates.drawBurgs();