summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-15 08:05:24 +0000
committerrubidium <rubidium@openttd.org>2007-06-15 08:05:24 +0000
commitd6267f553959089f1208cf59fd33410f78e86fe2 (patch)
treeb62c9a5927136dec8c578dfd3ad9ea5c7d7333c0 /src
parent54fbad017e407b928618890c4130a961fd37878b (diff)
downloadopenttd-d6267f553959089f1208cf59fd33410f78e86fe2.tar.xz
(svn r10165) -Fix [FS#874]: crash when trying to get the aircraft movement state of an aircraft going to a just deleted airport.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 5b9422a75..7a3e980eb 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -245,6 +245,8 @@ enum {
static byte MapAircraftMovementState(const Vehicle *v)
{
const Station *st = GetStation(v->u.air.targetairport);
+ if (st->airport_tile == 0) return AMS_TTDP_FLIGHT_TO_TOWER;
+
const AirportFTAClass *afc = st->Airport();
uint16 amdflag = afc->MovingData(v->u.air.pos)->flag;