From a1f28ec88bf3987236fb1b9df9c9dbe8c68419b7 Mon Sep 17 00:00:00 2001 From: yexo Date: Mon, 18 Jan 2010 14:32:47 +0000 Subject: (svn r18860) -Codechange: introduce a wrapper to get an hangar tile from a station --- src/aircraft_cmd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/aircraft_cmd.cpp') diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 91e6fb88e..719fc971d 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -334,11 +334,9 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin * of all depots, it is simple */ for (uint i = 0;; i++) { const Station *st = Station::GetByTile(tile); - const AirportSpec *as = st->GetAirportSpec(); const AirportFTAClass *apc = st->Airport(); - assert(i != as->nof_depots); - if (st->airport_tile + ToTileIndexDiff(as->depot_table[i]) == tile) { + if (st->GetHangarTile(i) == tile) { assert(apc->layout[i].heading == HANGAR); v->pos = apc->layout[i].position; break; -- cgit v1.2.3-54-g00ecf