summaryrefslogtreecommitdiff
path: root/newgrf_engine.c
diff options
context:
space:
mode:
authorrichk <richk@openttd.org>2006-06-23 22:05:40 +0000
committerrichk <richk@openttd.org>2006-06-23 22:05:40 +0000
commita832ca51feb61319cccd8501bbb9020df2135a9f (patch)
treee99c13a6de64e812b421e6c8a3019920196c8667 /newgrf_engine.c
parentea5f3af9b823bd2985ad2532acb58de5fa2ed6a2 (diff)
downloadopenttd-a832ca51feb61319cccd8501bbb9020df2135a9f.tar.xz
(svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
Commuter airport: Small. 5x4. 3 terminals, 2 helipads. Intercontinental: massive. 9x11. 8 terminals, 2 helipads, 4 runways. Helidepot: a small heliport with a depot for helis only. Helistation: a large heliport with 3 helipads and a depot.
Diffstat (limited to 'newgrf_engine.c')
-rw-r--r--newgrf_engine.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/newgrf_engine.c b/newgrf_engine.c
index 93d7bddaf..cc05de4ea 100644
--- a/newgrf_engine.c
+++ b/newgrf_engine.c
@@ -318,12 +318,16 @@ static byte MapAircraftMovementState(const Vehicle *v)
case TERM4:
case TERM5:
case TERM6:
+ case TERM7:
+ case TERM8:
/* TTDPatch only has 3 terminals, so treat these states the same */
if (amdflag & AMED_EXACTPOS) return AMS_TTDP_TO_PAD3;
return AMS_TTDP_TO_ENTRY_2_AND_3_AND_H;
case HELIPAD1:
- case HELIPAD2: // Will only occur for helicopters.
+ case HELIPAD2:
+ case HELIPAD3:
+ case HELIPAD4: // Will only occur for helicopters.
if (amdflag & AMED_HELI_LOWER) return AMS_TTDP_HELI_LAND_AIRPORT; // Descending.
if (amdflag & AMED_SLOWTURN) return AMS_TTDP_FLIGHT_TO_TOWER; // Still hasn't started descent.
return AMS_TTDP_TO_JUNCTION; // On the ground.
@@ -343,6 +347,12 @@ static byte MapAircraftMovementState(const Vehicle *v)
case AT_LARGE:
case AT_METROPOLITAN:
case AT_INTERNATIONAL:
+ case AT_COMMUTER:
+ case AT_INTERCON:
+ /* Note, Helidepot and Helistation are treated as airports as
+ * helicopters are taking off from ground level. */
+ case AT_HELIDEPOT:
+ case AT_HELISTATION:
if (amdflag & AMED_HELI_RAISE) return AMS_TTDP_HELI_TAKEOFF_AIRPORT;
return AMS_TTDP_TO_JUNCTION;
@@ -374,6 +384,8 @@ static byte MapAircraftMovementState(const Vehicle *v)
return AMS_TTDP_HELI_LAND_HELIPORT;
default:
+ /* Note, Helidepot and Helistation are treated as airports as
+ * helicopters are landing at ground level. */
return AMS_TTDP_HELI_LAND_AIRPORT;
}
}
@@ -432,6 +444,10 @@ static byte MapAircraftMovementAction(const Vehicle *v)
case TERM4:
case TERM5:
case TERM6:
+ case TERM7:
+ case TERM8:
+ case HELIPAD3:
+ case HELIPAD4:
return (v->current_order.type == OT_LOADING) ? AMA_TTDP_ON_PAD3 : AMA_TTDP_LANDING_TO_PAD3;
case TAKEOFF: // Moving to takeoff position
@@ -615,13 +631,19 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
byte airporttype;
switch (GetStation(v->u.air.targetairport)->airport_type) {
- case AT_SMALL: airporttype = ATP_TTDP_SMALL; break;
+ /* 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_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;
+ 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;
}
return (altitude << 8) | airporttype;