diff options
author | yexo <yexo@openttd.org> | 2010-03-19 11:17:52 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-03-19 11:17:52 +0000 |
commit | 1579e9ded29b89678e4c56ac82b6907537a920a7 (patch) | |
tree | c043257beec5af4474692a648fcc16b39d33c4d2 /src/station_cmd.cpp | |
parent | f2743cd5ed72a2d6224ffa828aab796ed771cef2 (diff) | |
download | openttd-1579e9ded29b89678e4c56ac82b6907537a920a7.tar.xz |
(svn r19465) -Codechange: support for multi-tile hangars
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 74ad7e060..9a6c21280 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2294,7 +2294,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags) if (flags & DC_EXEC) { const AirportSpec *as = st->airport.GetSpec(); - for (uint i = 0; i < as->nof_depots; ++i) { + for (uint i = 0; i < st->airport.GetNumHangars(); ++i) { DeleteWindowById( WC_VEHICLE_DEPOT, st->airport.GetHangarTile(i) ); @@ -2916,14 +2916,15 @@ static void AnimateTile_Station(TileIndex tile) static bool ClickTile_Station(TileIndex tile) { - const BaseStation *st = BaseStation::GetByTile(tile); + const BaseStation *bst = BaseStation::GetByTile(tile); - if (st->facilities & FACIL_WAYPOINT) { - ShowWaypointWindow(Waypoint::From(st)); + if (bst->facilities & FACIL_WAYPOINT) { + ShowWaypointWindow(Waypoint::From(bst)); } else if (IsHangar(tile)) { - ShowDepotWindow(tile, VEH_AIRCRAFT); + const Station *st = Station::From(bst); + ShowDepotWindow(st->airport.GetHangarTile(st->airport.GetHangarNum(tile)), VEH_AIRCRAFT); } else { - ShowStationViewWindow(st->index); + ShowStationViewWindow(bst->index); } return true; } |