summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/api/ai_station.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_station.cpp b/src/ai/api/ai_station.cpp
index ab171a307..aaaedd972 100644
--- a/src/ai/api/ai_station.cpp
+++ b/src/ai/api/ai_station.cpp
@@ -26,7 +26,7 @@
/* static */ StationID AIStation::GetStationID(TileIndex tile)
{
- if (!::IsTileType(tile, MP_STATION)) return INVALID_STATION;
+ if (!::IsValidTile(tile) || !::IsTileType(tile, MP_STATION)) return INVALID_STATION;
return ::GetStationIndex(tile);
}