changed biome to use pack instead of its own variable

This commit is contained in:
Zoltan 2019-11-12 10:56:50 -08:00
parent 23c9538b79
commit fe51098b16
10 changed files with 39 additions and 41 deletions

View file

@ -173,7 +173,7 @@
for (const c of cells.c[n]) {
if (cells.h[c] < 20) continue; // ignore water cells
const stateChangeCost = cells.state && cells.state[c] !== cells.state[n] ? 400 : 0; // trails tend to lay within the same state
const habitedCost = Math.max(100 - biomesData.biomeList[cells.biome[c]].habitability, 0); // routes tend to lay within populated areas
const habitedCost = Math.max(100 - pack.biomes[cells.biome[c]].habitability, 0); // routes tend to lay within populated areas
const heightChangeCost = Math.abs(cells.h[c] - cells.h[n]) * 10; // routes tend to avoid elevation changes
const cellCoast = 10 + stateChangeCost + habitedCost + heightChangeCost;
const totalCost = p + (cells.road[c] || cells.burg[c] ? cellCoast / 3 : cellCoast);