(svn r10165) -Fix [FS#874]: crash when trying to get the aircraft movement state of an aircraft going to a just deleted airport.

This commit is contained in:
rubidium 2007-06-15 08:05:24 +00:00
parent 54fbad017e
commit d6267f5539
1 changed files with 2 additions and 0 deletions

View File

@ -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;