diff options
author | frosch <frosch@openttd.org> | 2013-12-08 15:44:09 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-12-08 15:44:09 +0000 |
commit | bf0e7c34e6b2031135eccd9f8a68f4f2157bccbb (patch) | |
tree | da340edf5f2eb6fcfdaed27ae000fd6f03a8e4a9 /src/script/api/script_road.cpp | |
parent | 2e79fd9c4015a1777f52431b524f02aa1ce82a15 (diff) | |
download | openttd-bf0e7c34e6b2031135eccd9f8a68f4f2157bccbb.tar.xz |
(svn r26149) -Fix [FS#5825]: [Script] Various API functions did not check whether ScrtipRoad::SetCurrentRoadType was called appropiately.
Diffstat (limited to 'src/script/api/script_road.cpp')
-rw-r--r-- | src/script/api/script_road.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index e4980296c..445446695 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -32,6 +32,7 @@ /* static */ bool ScriptRoad::IsRoadDepotTile(TileIndex tile) { if (!::IsValidTile(tile)) return false; + if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false; return ::IsTileType(tile, MP_ROAD) && ::GetRoadTileType(tile) == ROAD_TILE_DEPOT && (::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType()) & ::GetRoadTypes(tile)) != 0; @@ -40,6 +41,7 @@ /* static */ bool ScriptRoad::IsRoadStationTile(TileIndex tile) { if (!::IsValidTile(tile)) return false; + if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false; return ::IsRoadStopTile(tile) && (::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType()) & ::GetRoadTypes(tile)) != 0; } @@ -47,6 +49,7 @@ /* static */ bool ScriptRoad::IsDriveThroughRoadStationTile(TileIndex tile) { if (!::IsValidTile(tile)) return false; + if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false; return ::IsDriveThroughStopTile(tile) && (::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType()) & ::GetRoadTypes(tile)) != 0; } |