diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 12:04:33 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 12:22:10 -0400 |
| commit | f08ad77b5720ee68c7efa65686cbae1bf6486a0e (patch) | |
| tree | 6d2685351d311ed382f584e6aee2e8474d54bf70 /go | |
| parent | f674e565a212b49e82b0e8f04018b5d371ad062f (diff) | |
| download | muhqs-game-f08ad77b5720ee68c7efa65686cbae1bf6486a0e.tar.gz muhqs-game-f08ad77b5720ee68c7efa65686cbae1bf6486a0e.zip | |
add king tile assertion
Diffstat (limited to 'go')
| -rw-r--r-- | go/game/map.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/go/game/map.go b/go/game/map.go index d918d87d..2b0bebd7 100644 --- a/go/game/map.go +++ b/go/game/map.go @@ -104,6 +104,9 @@ func ParseMap(data []byte) (*Map, error) { owner := s.PlayerById(i + 1) // TODO: Fix position index base. pos := Position{kingPos[0] - 1, kingPos[1] - 1} + if m.TileAt(pos) == nil { + log.Panic("invalid king pos", pos, len(m.Tiles[0]), "x", len(m.Tiles), "map") + } s.addNewUnit(card, pos, owner) } } |
