summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-23 18:45:05 +0000
committerrubidium <rubidium@openttd.org>2009-12-23 18:45:05 +0000
commit97e7a584a2d29b2c23f1867a14c860ce63bf9105 (patch)
treec5a05bfd67c1c462b26c3d5d6603409144bbcee3 /src/aircraft_cmd.cpp
parent277794e26bc005488300cc7df76a1278276246d7 (diff)
downloadopenttd-97e7a584a2d29b2c23f1867a14c860ce63bf9105.tar.xz
(svn r18616) -Fix [FS#3413]: crash when the current order is a conditional order when a plane is checking whether it needs servicing
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
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);