(svn r16614) -Codechange: Make the airport min/max available year a property of the Airport class.

-Change: rename station.always_small_airport to station.never_expire_airports to make it more future-proof
This commit is contained in:
yexo
2009-06-21 13:26:30 +00:00
parent 3531315322
commit 679ffee940
54 changed files with 58 additions and 104 deletions

View File

@@ -1718,15 +1718,17 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (distant_join && (!_settings_game.station.distant_join_stations || !Station::IsValidID(station_to_join))) return CMD_ERROR;
/* Check if a valid, buildable airport was chosen for construction */
if (p1 >= NUM_AIRPORTS || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
if (p1 >= NUM_AIRPORTS) return CMD_ERROR;
if (!CheckIfAuthorityAllowsNewStation(tile, flags)) {
return CMD_ERROR;
}
Town *t = ClosestTownFromTile(tile, UINT_MAX);
/* Check if a valid, buildable airport was chosen for construction */
const AirportFTAClass *afc = GetAirport(p1);
if (!afc->IsAvailable()) return CMD_ERROR;
Town *t = ClosestTownFromTile(tile, UINT_MAX);
int w = afc->size_x;
int h = afc->size_y;
Station *st = NULL;