diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-15 16:31:06 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:50 +0100 |
| commit | 0edb119b497bf1283f976693b02e044033d4de08 (patch) | |
| tree | e088ee82bd402d0b8f9b129a3eb5ea221c80514e /go/game/ai.go | |
| parent | 55e61b7e74a72178f8c124539318fec9773f0ff7 (diff) | |
| download | muhqs-game-0edb119b497bf1283f976693b02e044033d4de08.tar.gz muhqs-game-0edb119b497bf1283f976693b02e044033d4de08.zip | |
fix ai NPE when selecting a unit where to spawn frost pylon
The NPE is caused by any piled permanent with which TilesInRange is
called.
Diffstat (limited to 'go/game/ai.go')
| -rw-r--r-- | go/game/ai.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/go/game/ai.go b/go/game/ai.go index 9b48c2f5..9f1ef488 100644 --- a/go/game/ai.go +++ b/go/game/ai.go @@ -121,7 +121,7 @@ func (m *Map) generateMapGraphFor(u *Unit) *dijkstra.Graph { } func findPathTo(graph *dijkstra.Graph, u *Unit, pos Position) (dijkstra.BestPath, error) { - srcId, err := graph.GetMapping(u.TileOrContainingPermTile().Position.String()) + srcId, err := graph.GetMapping(TileOrContainingPermTile(u).Position.String()) if err != nil { log.Fatalf("No mapping %s in Graph: %s", u.Tile().Position.String(), err) } |
