(svn r10165) -Fix [FS#874]: crash when trying to get the aircraft movement state of an aircraft going to a just deleted airport.
authorrubidium
Fri, 15 Jun 2007 08:05:24 +0000
changeset 6912 259420c519b9
parent 6911 295a78cc3769
child 6913 ff5f8a9c1747
(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
--- a/src/newgrf_engine.cpp	Fri Jun 15 05:44:45 2007 +0000
+++ b/src/newgrf_engine.cpp	Fri Jun 15 08:05:24 2007 +0000
@@ -245,6 +245,8 @@
 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;