From 025b1c93335b6b454810ad195be35342a926491e Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sat, 22 Feb 2025 20:32:35 -0800 Subject: [PATCH] fix fencepost error when merging regions --- src/mapgen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapgen.ts b/src/mapgen.ts index 0b0f73c..2b0d924 100644 --- a/src/mapgen.ts +++ b/src/mapgen.ts @@ -574,7 +574,7 @@ function connectRegions(knife: Knife) { if (Math.random() > EXTRA_CONNECTOR_CHANCE) { // at random, don't regard them as merged - for (let i = 0; i < knife.region; i++) { + for (let i = 0; i <= knife.region; i++) { if (sources.indexOf(merged[i]) != -1) { merged[i] = dest; }