mirror of https://github.com/OpenTTD/OpenTTD
(svn r15093) -Fix [NoAI]: check if a tile is valid before using IsTileType (bug found by Zuu, patch by Yexo)
parent
7eac17f5ea
commit
3e7c2bbacc
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
/* static */ StationID AIStation::GetStationID(TileIndex tile)
|
/* 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);
|
return ::GetStationIndex(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue