diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 12:04:33 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:29 +0200 |
| commit | f1de37305b53d719240b1bff562c90990df66b92 (patch) | |
| tree | 168931a8d7ed629e6b8cbd41e1a889de4712bf6b | |
| parent | d7b595d3d116429d442f6b03d6a1a19ab58486ad (diff) | |
| download | muhqs-game-f1de37305b53d719240b1bff562c90990df66b92.tar.gz muhqs-game-f1de37305b53d719240b1bff562c90990df66b92.zip | |
add king tile assertion
| -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) } } |
