aboutsummaryrefslogtreecommitdiff
path: root/go/ui/mapView.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-19 18:36:00 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:25 +0200
commitc7289b4d4a605be3bb6dacafd0cd8e77fa549861 (patch)
treed4451b4cd6be2fa264ecc1b333f6327ca6543619 /go/ui/mapView.go
parent11d468baf7a5920eef326c566e4091a4ddfbe937 (diff)
downloadmuhqs-game-c7289b4d4a605be3bb6dacafd0cd8e77fa549861.tar.gz
muhqs-game-c7289b4d4a605be3bb6dacafd0cd8e77fa549861.zip
fix handling of straight streets
Diffstat (limited to 'go/ui/mapView.go')
-rw-r--r--go/ui/mapView.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/go/ui/mapView.go b/go/ui/mapView.go
index 25ebd5aa..9b1cd206 100644
--- a/go/ui/mapView.go
+++ b/go/ui/mapView.go
@@ -102,9 +102,8 @@ func (vw *MapView) handleStreet(x, y int, op *ebiten.DrawImageOptions) *ebiten.I
if connections == 0 {
log.Printf("Street at (%d, %d) is not connected", x, y)
img = assets.GetTile("street")
- } else if (connections == 1 ||
- (connections == 2 && ((left && right) || (above && below)))) &&
- (above || below) {
+ } else if connections == 1 ||
+ (connections == 2 && ((left && right) || (above && below))) {
img = assets.GetTile("street")
if above || below {
@@ -258,6 +257,9 @@ func (vw *MapView) drawMapLayer(screen *ebiten.Image) {
default:
tileImg = assets.GetTile(tile.Raw)
}
+ if tileImg == nil {
+ log.Panic("failed to load tile", tile.Raw)
+ }
op.GeoM.Translate(x_px, y_px)