From 85740a02832c9c474833f929b4464eba06be66d3 Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 19 Aug 2010 13:44:41 +0000 Subject: (svn r20559) -Fix [FS#4045]: make sure that all vehicles are build in the most northern depot/hangar tile --- src/aircraft_cmd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/aircraft_cmd.cpp') 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 -- cgit v1.2.3-54-g00ecf