From a7e01457360fae2062e23c3b2b3406c2853cab7b Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sat, 13 Jan 2024 11:44:44 -0500 Subject: [PATCH] reimpl erosion --- island/grid.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/island/grid.ts b/island/grid.ts index 50a5df2..4b7b916 100644 --- a/island/grid.ts +++ b/island/grid.ts @@ -147,7 +147,9 @@ export class IslandGrid { ); this.dropWithin(mountainTiles); // GENERATOR - // const erodePos = islandTiles[islands.rng() % islandTiles.length]; - // islands.data[erodePos] = Math.max(islands.data[erodePos] - 1, 0); + if (lowlandTiles2.length > 1) { + const erodePos = lowlandTiles2[this.rng() % lowlandTiles2.length]; + this.data[erodePos] = Math.max(this.data[erodePos] - 1, 0); + } } }