mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: routes - auto-update part 1
This commit is contained in:
parent
da2d6fc584
commit
126393fea3
3 changed files with 41 additions and 7 deletions
3
main.js
3
main.js
|
|
@ -1176,7 +1176,6 @@ function reGraph() {
|
|||
for (const i of gridCells.i) {
|
||||
const height = gridCells.h[i];
|
||||
const type = gridCells.t[i];
|
||||
const isOnBorder = gridCells.b[i];
|
||||
|
||||
// exclude most of ocean points
|
||||
if (height < 20) {
|
||||
|
|
@ -1195,7 +1194,7 @@ function reGraph() {
|
|||
|
||||
// add additional points for cells along coast
|
||||
if (type === 1 || type === -1) {
|
||||
if (isOnBorder) continue; // not for near-border cells
|
||||
if (gridCells.b[i]) continue; // not for near-border cells
|
||||
gridCells.c[i].forEach(function (e) {
|
||||
if (i > e) return;
|
||||
if (gridCells.t[e] === type) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue