mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
burg check added to unitUtils population conversion
This commit is contained in:
parent
7519ed097e
commit
c3dd1d9e6f
1 changed files with 3 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {rn} from "./numberUtils";
|
||||
import {findCell, findGridCell} from "./graphUtils";
|
||||
import {getInputNumber, getInputValue} from "./nodeUtils";
|
||||
import { isBurg } from "./typeUtils";
|
||||
|
||||
// ***
|
||||
// SI
|
||||
|
|
@ -136,7 +137,8 @@ export function getBurgPopulationPoints(burgPopulationValue: number) {
|
|||
export function getCellPopulation(cellId: number) {
|
||||
const rural = getRuralPopulation(pack.cells.pop[cellId]);
|
||||
const burgId = pack.cells.burg[cellId];
|
||||
const urban = burgId ? getBurgPopulation(pack.burgs[burgId].population) : 0;
|
||||
const burg = pack.burgs[burgId];
|
||||
const urban = isBurg(burg) ? getBurgPopulation(burg.population) : 0;
|
||||
return [rural, urban];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue