diff options
author | yexo <yexo@openttd.org> | 2010-08-19 13:44:41 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-19 13:44:41 +0000 |
commit | 85740a02832c9c474833f929b4464eba06be66d3 (patch) | |
tree | 9e10d3039ec55bce24ceebffd0c4c949be1f45ee /src/aircraft_cmd.cpp | |
parent | 16be24e13acf17a3292b490196d301b5b1aa1056 (diff) | |
download | openttd-85740a02832c9c474833f929b4464eba06be66d3.tar.xz |
(svn r20559) -Fix [FS#4045]: make sure that all vehicles are build in the most northern depot/hangar tile
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index ecba1df29..511df3aeb 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -225,9 +225,13 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height) CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret) { const AircraftVehicleInfo *avi = &e->u.air; + const Station *st = Station::GetByTile(tile); /* Prevent building aircraft types at places which can't handle them */ - if (!CanVehicleUseStation(e->index, Station::GetByTile(tile))) return CMD_ERROR; + if (!CanVehicleUseStation(e->index, st)) return CMD_ERROR; + + /* Make sure all aircraft end up in the first tile of the hanger. */ + tile = st->airport.GetHangarTile(st->airport.GetHangarNum(tile)); if (flags & DC_EXEC) { Aircraft *v = new Aircraft(); // aircraft |