summaryrefslogtreecommitdiff
path: root/src/newgrf_airport.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-05 23:21:51 +0000
committeryexo <yexo@openttd.org>2010-03-05 23:21:51 +0000
commit585b036c90b9984bf5a1ecc79e6932182fa8adc0 (patch)
treedf4b7bd9a7b682d76ec4209622545fe90e825209 /src/newgrf_airport.cpp
parentc42e2a9bfc2114d54257832a644d485244c0c537 (diff)
downloadopenttd-585b036c90b9984bf5a1ecc79e6932182fa8adc0.tar.xz
(svn r19327) -Codechange: make the oilrig a part of the original airports array so some special cases can be removed
Diffstat (limited to 'src/newgrf_airport.cpp')
-rw-r--r--src/newgrf_airport.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp
index cad50c044..e39ab29a9 100644
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -20,8 +20,7 @@
static AirportClass _airport_classes[APC_MAX];
-AirportSpec AirportSpec::dummy = {NULL, NULL, 0, 0, 0, 0, 0, MIN_YEAR, MIN_YEAR, STR_NULL, ATP_TTDP_LARGE, APC_BEGIN};
-AirportSpec AirportSpec::oilrig = {NULL, NULL, 0, 1, 1, 0, 4, MIN_YEAR, MIN_YEAR, STR_NULL, ATP_TTDP_OILRIG, APC_BEGIN};
+AirportSpec AirportSpec::dummy = {NULL, NULL, 0, 0, 0, 0, 0, MIN_YEAR, MIN_YEAR, STR_NULL, ATP_TTDP_LARGE, APC_BEGIN, false};
AirportSpec AirportSpec::specs[NUM_AIRPORTS];
@@ -33,7 +32,6 @@ AirportSpec AirportSpec::specs[NUM_AIRPORTS];
*/
/* static */ const AirportSpec *AirportSpec::Get(byte type)
{
- if (type == AT_OILRIG) return &oilrig;
assert(type < lengthof(AirportSpec::specs));
return &AirportSpec::specs[type];
}
@@ -46,13 +44,13 @@ AirportSpec AirportSpec::specs[NUM_AIRPORTS];
*/
/* static */ AirportSpec *AirportSpec::GetWithoutOverride(byte type)
{
- if (type == AT_OILRIG) return &oilrig;
assert(type < lengthof(AirportSpec::specs));
return &AirportSpec::specs[type];
}
bool AirportSpec::IsAvailable() const
{
+ if (!this->enabled) return false;
if (_cur_year < this->min_year) return false;
if (_settings_game.station.never_expire_airports) return true;
return _cur_year <= this->max_year;
@@ -156,7 +154,7 @@ void BindAirportSpecs()
{
for (int i = 0; i < NUM_AIRPORTS; i++) {
AirportSpec *as = AirportSpec::GetWithoutOverride(i);
- BindAirportSpecToClass(as);
+ if (as->enabled) BindAirportSpecToClass(as);
}
}