diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-15 16:42:23 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:50:10 +0200 |
| commit | 5fcc4eb5420e202b54ec060bcda478ff5ccf3b5e (patch) | |
| tree | 66da47b4a1498f86c5448f2558b100ae6525e427 | |
| parent | 45c75899632d7ff14e9e32f073d7a3ace7e1230f (diff) | |
| download | muhqs-game-5fcc4eb5420e202b54ec060bcda478ff5ccf3b5e.tar.gz muhqs-game-5fcc4eb5420e202b54ec060bcda478ff5ccf3b5e.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 } |
