mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-13 07:10:57 +00:00
(svn r15093) -Fix [NoAI]: check if a tile is valid before using IsTileType (bug found by Zuu, patch by Yexo)
This commit is contained in:
parent
e67040a1a0
commit
fe7997e95f
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user