summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 52a011673..cce161e15 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -315,20 +315,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
_new_vehicle_id = v->index;
- /* When we click on hangar we know the tile it is on. By that we know
- * its position in the array of depots the airport has.....we can search
- * layout for #th position of depot. Since layout must start with a listing
- * of all depots, it is simple */
- for (uint i = 0;; i++) {
- const Station *st = Station::GetByTile(tile);
- const AirportFTAClass *apc = st->Airport();
-
- if (st->GetHangarTile(i) == tile) {
- assert(apc->layout[i].heading == HANGAR);
- v->pos = apc->layout[i].position;
- break;
- }
- }
+ v->pos = GetVehiclePosOnBuild(tile);
v->state = HANGAR;
v->previous_pos = v->pos;