summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-11-19 14:48:12 +0000
committerrubidium <rubidium@openttd.org>2008-11-19 14:48:12 +0000
commitb00bfa0adf306ddb8811b150176c6867f37588c3 (patch)
treeefcc2f7456662e6bb4bc6df597aff448f819b36e
parentaaeb01b428d90b7b7e9930e7f93143c64eca85b7 (diff)
downloadopenttd-b00bfa0adf306ddb8811b150176c6867f37588c3.tar.xz
(svn r14594) -Fix [FS#2412]: trains could get their their last visited station reset when still (un)loading causing an invalid state.
-rw-r--r--src/train_cmd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index c78d1ef54..c70a9b096 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2814,10 +2814,16 @@ private:
Vehicle *v;
Order old_order;
TileIndex old_dest_tile;
+ StationID old_last_station_visited;
VehicleOrderID index;
public:
- VehicleOrderSaver(Vehicle *_v) : v(_v), old_order(_v->current_order), old_dest_tile(_v->dest_tile), index(_v->cur_order_index)
+ VehicleOrderSaver(Vehicle *_v) :
+ v(_v),
+ old_order(_v->current_order),
+ old_dest_tile(_v->dest_tile),
+ old_last_station_visited(_v->last_station_visited),
+ index(_v->cur_order_index)
{
}
@@ -2825,6 +2831,7 @@ public:
{
this->v->current_order = this->old_order;
this->v->dest_tile = this->old_dest_tile;
+ this->v->last_station_visited = this->old_last_station_visited;
}
/**