diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-15 16:42:23 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:50 +0100 |
| commit | edc4efbe42a94660d9d530b61c5963c298bd3597 (patch) | |
| tree | 95cbe3588dc7efe050cf22e81fb5e280de9ab655 | |
| parent | f9fef6046fdc6895d5eaa7fc15d9b4f4a02becae (diff) | |
| download | muhqs-game-edc4efbe42a94660d9d530b61c5963c298bd3597.tar.gz muhqs-game-edc4efbe42a94660d9d530b61c5963c298bd3597.zip | |
fix Wandering AI NPE for piled units
| -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 0500c88a..1aa0be62 100644 --- a/go/game/ai.go +++ b/go/game/ai.go @@ -314,7 +314,7 @@ out: func WanderingAI(ai *UnitAI, x int) { // 1. for _, enemyUnit := range ai.s.EnemyUnits(ai.u.Controller()) { - if IsPositionInRange(ai.u.Tile().Position, enemyUnit.Tile().Position, x) { + if IsPositionInRange(ai.u.Tile().Position, TileOrContainingPermTile(enemyUnit).Position, x) { AggressiveAI(ai) break } |
