summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-25 20:10:02 +0000
committerfrosch <frosch@openttd.org>2011-05-25 20:10:02 +0000
commit87515d08738124466fc3e9da4467444d4dd1d14d (patch)
treeac295edbb48fa711e585da14735ebbb3fdb075d4
parentcee94be7dbafbd40602072ecc2601be18745689f (diff)
downloadopenttd-87515d08738124466fc3e9da4467444d4dd1d14d.tar.xz
(svn r22492) -Fix [FS#4624] (r21642, r22328): Only try to insert implicit orders for ground vehicles. Aircraft may reach unscheduled terminals when skippnig orders etc.
-rw-r--r--src/vehicle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 41aebff10..397f60f60 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1854,16 +1854,16 @@ void Vehicle::BeginLoading()
this->current_order.SetNonStopType(ONSF_NO_STOP_AT_ANY_STATION);
} else {
- assert(this->IsGroundVehicle());
- bool suppress_implicit_orders = HasBit(this->GetGroundVehicleFlags(), GVF_SUPPRESS_IMPLICIT_ORDERS);
-
/* We weren't scheduled to stop here. Insert an implicit order
* to show that we are stopping here, but only do that if the order
- * list isn't empty. */
+ * list isn't empty.
+ * While only groundvehicles have implicit orders, e.g. aircraft might still enter
+ * the 'wrong' terminal when skipping orders etc. */
Order *in_list = this->GetOrder(this->cur_implicit_order_index);
- if (in_list != NULL &&
+ if (this->IsGroundVehicle() && in_list != NULL &&
(!in_list->IsType(OT_IMPLICIT) ||
in_list->GetDestination() != this->last_station_visited)) {
+ bool suppress_implicit_orders = HasBit(this->GetGroundVehicleFlags(), GVF_SUPPRESS_IMPLICIT_ORDERS);
/* Do not create consecutive duplicates of implicit orders */
Order *prev_order = this->cur_implicit_order_index > 0 ? this->GetOrder(this->cur_implicit_order_index - 1) : NULL;
if (prev_order == NULL ||