From 3e7c2bbacc8e44846f2f3f6a0b4b8c8183b25e1b Mon Sep 17 00:00:00 2001 From: truebrain Date: Thu, 15 Jan 2009 17:00:47 +0000 Subject: (svn r15093) -Fix [NoAI]: check if a tile is valid before using IsTileType (bug found by Zuu, patch by Yexo) --- src/ai/api/ai_station.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ai') 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); } -- cgit v1.2.3-70-g09d2