diff options
author | michi_cc <michi_cc@openttd.org> | 2012-06-23 15:02:20 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-06-23 15:02:20 +0000 |
commit | ef394916c93a702250d7bd677f163beea880a989 (patch) | |
tree | 785ef1513cbf3e5f715536427d9184baef9b1d03 /src | |
parent | 9208059e3e3cc168e356eadddf93584849c1edcc (diff) | |
download | openttd-ef394916c93a702250d7bd677f163beea880a989.tar.xz |
(svn r24353) -Fix [FS#5215] (r23506): [NoAI] A TileIndex isn't a station id, so don't use it as one.
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/script_order.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index d2ba554e7..8b55cabb4 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -659,8 +659,8 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) /* static */ uint ScriptOrder::GetOrderDistance(ScriptVehicle::VehicleType vehicle_type, TileIndex origin_tile, TileIndex dest_tile) { if (vehicle_type == ScriptVehicle::VT_AIR) { - if (ScriptTile::IsStationTile(origin_tile) && ::Station::Get(origin_tile)->airport.tile != INVALID_TILE) origin_tile = ::Station::Get(origin_tile)->airport.tile; - if (ScriptTile::IsStationTile(dest_tile) && ::Station::Get(dest_tile)->airport.tile != INVALID_TILE) dest_tile = ::Station::Get(dest_tile)->airport.tile; + if (ScriptTile::IsStationTile(origin_tile) && ::Station::GetByTile(origin_tile)->airport.tile != INVALID_TILE) origin_tile = ::Station::GetByTile(origin_tile)->airport.tile; + if (ScriptTile::IsStationTile(dest_tile) && ::Station::GetByTile(dest_tile)->airport.tile != INVALID_TILE) dest_tile = ::Station::GetByTile(dest_tile)->airport.tile; return ScriptMap::DistanceSquare(origin_tile, dest_tile); } else { |