From d6267f553959089f1208cf59fd33410f78e86fe2 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 15 Jun 2007 08:05:24 +0000 Subject: [PATCH] (svn r10165) -Fix [FS#874]: crash when trying to get the aircraft movement state of an aircraft going to a just deleted airport. --- src/newgrf_engine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 5b9422a753..7a3e980eb4 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;