summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-10 17:39:43 +0000
committerfrosch <frosch@openttd.org>2009-01-10 17:39:43 +0000
commit1fdd53e428c032505c330d32327057dc12f7ebde (patch)
tree3ac521259aa68c37f3b7ea6e9a8605691cb10ec2 /src/train_cmd.cpp
parent6ef631d590011b2c1529b8299f66dd54b23084a8 (diff)
downloadopenttd-1fdd53e428c032505c330d32327057dc12f7ebde.tar.xz
(svn r14975) -Fix (r14957): Do not immediatelly move the train when leaving the station and the destination is not yet known.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 8fc439dd5..1ed39f811 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3652,6 +3652,12 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
{
Vehicle *prev;
+ if (v->current_order.IsType(OT_LEAVESTATION)) {
+ v->current_order.Free();
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ return;
+ }
+
/* For every vehicle after and including the given vehicle */
for (prev = v->Previous(); v != nomove; prev = v, v = v->Next()) {
DiagDirection enterdir = DIAGDIR_BEGIN;
@@ -3680,9 +3686,6 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
if (HasBit(r, VETS_ENTERED_STATION)) {
/* The new position is the end of the platform */
TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
- } else if (v->current_order.IsType(OT_LEAVESTATION)) {
- v->current_order.Free();
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
} else {