summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-15 17:00:47 +0000
committertruebrain <truebrain@openttd.org>2009-01-15 17:00:47 +0000
commit3e7c2bbacc8e44846f2f3f6a0b4b8c8183b25e1b (patch)
tree6cda3c46aea0fb26aac9600479087ed0703783ab /src
parent7eac17f5ea6db07e53b62dd74f07bc32d7d67596 (diff)
downloadopenttd-3e7c2bbacc8e44846f2f3f6a0b4b8c8183b25e1b.tar.xz
(svn r15093) -Fix [NoAI]: check if a tile is valid before using IsTileType (bug found by Zuu, patch by Yexo)
Diffstat (limited to 'src')
-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);
}