summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-01-31 20:44:15 +0000
committerfrosch <frosch@openttd.org>2011-01-31 20:44:15 +0000
commita97d52a29a990132a8a5e4dd60304483617cec50 (patch)
tree0d8d42d633feabb438f812cedf0534a3c665074e /src/train_cmd.cpp
parent67a5cd0b185158ca4926c8cb45f1735a1001e00b (diff)
downloadopenttd-a97d52a29a990132a8a5e4dd60304483617cec50.tar.xz
(svn r21933) -Codechange: Split cur_order_index into cur_auto_order_index and cur_real_order_index to keep track of the current real order in an unambiguous way.
-Fix [FS#4440]: Automatic orders behave now stable wrt. service orders and are not added or removed depending on the need of servicing. -Fix: Various other issues with automatic orders, e.g. vehicles getting stuck with "no orders" when there are automatic orders at the end of the order list.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 42ceb8ae8..58f19b6bf 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2291,7 +2291,7 @@ public:
old_order(_v->current_order),
old_dest_tile(_v->dest_tile),
old_last_station_visited(_v->last_station_visited),
- index(_v->cur_order_index)
+ index(_v->cur_real_order_index)
{
}
@@ -2348,7 +2348,7 @@ public:
/* Don't increment inside the while because otherwise conditional
* orders can lead to an infinite loop. */
++this->index;
- } while (this->index != this->v->cur_order_index);
+ } while (this->index != this->v->cur_real_order_index);
return false;
}
@@ -2602,7 +2602,7 @@ TileIndex Train::GetOrderStationLocation(StationID station)
const Station *st = Station::Get(station);
if (!(st->facilities & FACIL_TRAIN)) {
/* The destination station has no trainstation tiles. */
- this->IncrementOrderIndex();
+ this->IncrementRealOrderIndex();
return 0;
}