stopped branches between exits for roads

This commit is contained in:
Grimsace
2026-02-04 15:21:45 -06:00
parent b3dc2d1258
commit 908cca824f
+8 -1
View File
@@ -13,6 +13,7 @@ import (
type PointOfInterest struct { type PointOfInterest struct {
X, Y int X, Y int
Connections int Connections int
IsExit bool
} }
type Road struct { type Road struct {
@@ -108,7 +109,8 @@ func generatePOIs(width, height int, settings *Settings, allWaterPixels []image.
} }
} }
if found { if found {
pois = append(pois, &PointOfInterest{X: x, Y: y}) isExit := i < numExits
pois = append(pois, &PointOfInterest{X: x, Y: y, IsExit: isExit})
} }
} }
@@ -169,6 +171,11 @@ func connectPOIs(pois []*PointOfInterest, width, height int, settings *Settings,
continue continue
} }
// Don't connect two exit points
if poi.IsExit && other.IsExit {
continue
}
if closest == nil || dist < minDist { if closest == nil || dist < minDist {
minDist = dist minDist = dist
closest = other closest = other