fix fencepost error when merging regions

This commit is contained in:
Kistaro Windrider 2025-02-22 20:32:35 -08:00
parent e2aa4a3ee7
commit 025b1c9333
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -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;
}