(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

@@ -224,23 +224,14 @@ public:
{
int i; // airport enabling loop
uint16 y_noise_offset = 0;
uint32 avail_airports;
const AirportFTAClass *airport;
avail_airports = GetValidAirports();
this->RaiseWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
if (!HasBit(avail_airports, 0) && _selected_airport_type == AT_SMALL) _selected_airport_type = AT_LARGE;
if (!HasBit(avail_airports, 1) && _selected_airport_type == AT_LARGE) _selected_airport_type = AT_SMALL;
if (!GetAirport(AT_SMALL)->IsAvailable() && _selected_airport_type == AT_SMALL) _selected_airport_type = AT_LARGE;
if (!GetAirport(AT_LARGE)->IsAvailable() && _selected_airport_type == AT_LARGE) _selected_airport_type = AT_SMALL;
this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
/* 'Country Airport' starts at widget BAW_SMALL_AIRPORT, and if its bit is set, it is
* available, so take its opposite value to set the disabled state.
* There are 9 buildable airports
* XXX TODO : all airports should be held in arrays, with all relevant data.
* This should be part of newgrf-airports, i suppose
*/
for (i = 0; i < BAW_AIRPORT_COUNT; i++) this->SetWidgetDisabledState(i + BAW_SMALL_AIRPORT, !HasBit(avail_airports, i));
for (i = 0; i < BAW_AIRPORT_COUNT; i++) this->SetWidgetDisabledState(i + BAW_SMALL_AIRPORT, !GetAirport(i)->IsAvailable());
/* select default the coverage area to 'Off' (16) */
airport = GetAirport(_selected_airport_type);