(svn r20559) -Fix [FS#4045]: make sure that all vehicles are build in the most northern depot/hangar tile

This commit is contained in:
yexo
2010-08-19 13:44:41 +00:00
parent a4fbfa268b
commit e7f5780683
5 changed files with 21 additions and 6 deletions

View File

@@ -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