diff options
author | yexo <yexo@openttd.org> | 2010-03-18 18:38:32 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-03-18 18:38:32 +0000 |
commit | 89a069629ed2592b9b80134582d5ba2e959f7211 (patch) | |
tree | 29fa8dfb50254d94067c2768fb562243bed5af93 /src/aircraft_cmd.cpp | |
parent | eb8d35a16ec593c16ca720f0d1b2e623986ecea5 (diff) | |
download | openttd-89a069629ed2592b9b80134582d5ba2e959f7211.tar.xz |
(svn r19453) -Codechange: split getting the initial aircraft position to a new function
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 15 |
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; |