From ea89a3293c38a3aed8d997dec703a49dfb507b24 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sat, 13 Jan 2024 10:55:04 -0500 Subject: [PATCH] Focus forest growth on a contiguous mass --- island.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/island.ts b/island.ts index 3bb9c40..86d7c29 100644 --- a/island.ts +++ b/island.ts @@ -147,7 +147,8 @@ class IslandGrid { this.dropWithin(beachTiles); // expand forest - const forestTiles = lowlandTiles1.filter((pos) => this.data[pos] == 2); + const forestLobe = this.floodSearch(this.lobePos1, (tile) => tile > 1); + const forestTiles = forestLobe.filter((pos) => this.data[pos] == 2); this.dropWithin(forestTiles); this.dropWithin(forestTiles); this.dropWithin(forestTiles);