summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-01 20:17:21 +0000
committeryexo <yexo@openttd.org>2010-03-01 20:17:21 +0000
commit3cda09170cf9e2560029393f2b688d7afec70cf4 (patch)
tree558aca1ac5a4c117a75da455faf2d972241979b8 /src/newgrf_engine.cpp
parentfe5bb036a063d73b05bd15f5b6797e7c637e11ef (diff)
downloadopenttd-3cda09170cf9e2560029393f2b688d7afec70cf4.tar.xz
(svn r19299) -Codechange: store the most compatible ttd airport type in AirportSpec
-Fix: [NewGRF] return the ttd airport type in station var 0xF1
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 982fcf833..a60602abb 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -366,15 +366,6 @@ static byte MapAircraftMovementAction(const Aircraft *v)
}
-/* TTDP airport types. Used to map our types to TTDPatch's */
-enum {
- ATP_TTDP_SMALL,
- ATP_TTDP_LARGE,
- ATP_TTDP_HELIPORT,
- ATP_TTDP_OILRIG,
-};
-
-
/* Vehicle Resolver Functions */
static inline const Vehicle *GRV(const ResolverObject *object)
{
@@ -608,22 +599,8 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
const Station *st = GetTargetAirportIfValid(Aircraft::From(v));
- if (st != NULL) {
- switch (st->airport_type) {
- /* Note, Helidepot and Helistation are treated as small airports
- * as they are at ground level. */
- case AT_HELIDEPOT:
- case AT_HELISTATION:
- case AT_COMMUTER:
- case AT_SMALL: airporttype = ATP_TTDP_SMALL; break;
- case AT_METROPOLITAN:
- case AT_INTERNATIONAL:
- case AT_INTERCON:
- case AT_LARGE: airporttype = ATP_TTDP_LARGE; break;
- case AT_HELIPORT: airporttype = ATP_TTDP_HELIPORT; break;
- case AT_OILRIG: airporttype = ATP_TTDP_OILRIG; break;
- default: airporttype = ATP_TTDP_LARGE; break;
- }
+ if (st != NULL && st->airport.tile != INVALID_TILE) {
+ airporttype = st->GetAirportSpec()->ttd_airport_type;
}
return (altitude << 8) | airporttype;