From 97e7a584a2d29b2c23f1867a14c860ce63bf9105 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Dec 2009 18:45:05 +0000 Subject: (svn r18616) -Fix [FS#3413]: crash when the current order is a conditional order when a plane is checking whether it needs servicing --- src/aircraft_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/aircraft_cmd.cpp') diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 8ce5e1fd7..dfc9de1db 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -522,6 +522,10 @@ static void CheckIfAircraftNeedsService(Aircraft *v) return; } + /* When we're parsing conditional orders and the like + * we don't want to consider going to a depot too. */ + if (!v->current_order.IsType(OT_GOTO_DEPOT) && !v->current_order.IsType(OT_GOTO_STATION)) return; + const Station *st = Station::Get(v->current_order.GetDestination()); assert(st != NULL); -- cgit v1.2.3-54-g00ecf