changeset 14073:0d059932592a draft

(svn r18616) -Fix [FS#3413]: crash when the current order is a conditional order when a plane is checking whether it needs servicing
author rubidium <rubidium@openttd.org>
date Wed, 23 Dec 2009 18:45:05 +0000
parents 7a6b0728bf33
children 9c9f0b931912
files src/aircraft_cmd.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -522,6 +522,10 @@
 		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);