(svn r21808) -Fix: don't create automatic orders when there are no manual orders (fonsinchen)

This commit is contained in:
rubidium 2011-01-15 18:16:46 +00:00
parent bc9afec3b0
commit 4784c3ac3c
1 changed files with 5 additions and 5 deletions

View File

@ -1770,12 +1770,12 @@ void Vehicle::BeginLoading()
} else {
/* We weren't scheduled to stop here. Insert an automatic order
* to show that we are stopping here. */
* to show that we are stopping here, but only do that if the order
* list isn't empty. */
Order *in_list = this->GetOrder(this->cur_order_index);
if ((this->orders.list == NULL || this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID) &&
((in_list == NULL && this->cur_order_index == 0) ||
(in_list != NULL && (!in_list->IsType(OT_AUTOMATIC) ||
in_list->GetDestination() != this->last_station_visited)))) {
if (in_list != NULL && this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID &&
(!in_list->IsType(OT_AUTOMATIC) ||
in_list->GetDestination() != this->last_station_visited)) {
Order *auto_order = new Order();
auto_order->MakeAutomatic(this->last_station_visited);
InsertOrder(this, auto_order, this->cur_order_index);