Mercurial > hg > openttd
changeset 17071:cef968e48b30 draft
(svn r21808) -Fix: don't create automatic orders when there are no manual orders (fonsinchen)
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 15 Jan 2011 18:16:46 +0000 |
parents | 38c723434782 |
children | 22f02928bc1b |
files | src/vehicle.cpp |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1770,12 +1770,12 @@ } 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);