diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-09-08 22:33:28 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-09-08 22:33:28 +0200 |
| commit | cb2f9a824428448bd889f2e6df11b413cea15f40 (patch) | |
| tree | 58844b05e83224ffa72a5305acb505b9687823d2 | |
| parent | 2863f09e46ba923daea3761a8b0342dc38029530 (diff) | |
| download | muhqs-game-cb2f9a824428448bd889f2e6df11b413cea15f40.tar.gz muhqs-game-cb2f9a824428448bd889f2e6df11b413cea15f40.zip | |
do not assume a unit always has a tile
| -rw-r--r-- | go/game/unit.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/go/game/unit.go b/go/game/unit.go index 2ab9fcf8..921be3f0 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -216,7 +216,7 @@ func (u *Unit) AvailSlowActions() (actions []Action) { actions = append(actions, NewMoveAction(u)) } - if u.AvailStreetActions > 0 && u.Movement != INVALID_MOVEMENT() && u.Tile().Type == TileTypes.Street { + if u.AvailStreetActions > 0 && u.Movement != INVALID_MOVEMENT() && u.Tile() != nil && u.Tile().Type == TileTypes.Street { actions = append(actions, NewStreetAction(u)) } |
