summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index f513fbc01..38c35609a 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1786,14 +1786,17 @@ static void ReverseTrainDirection(Vehicle *v)
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
}
- /* update all images */
- for (Vehicle *u = v; u != NULL; u = u->Next()) {
- ToggleBit(u->u.rail.flags, VRF_TOGGLE_REVERSE);
- u->cur_image = u->GetImage(u->direction);
- }
+ /* set reversed flag on all parts */
+ for (Vehicle *u = v; u != NULL; u = u->Next()) ToggleBit(u->u.rail.flags, VRF_TOGGLE_REVERSE);
ClrBit(v->u.rail.flags, VRF_REVERSING);
+ /* recalculate cached data */
+ TrainConsistChanged(v);
+
+ /* update all images */
+ for (Vehicle *u = v; u != NULL; u = u->Next()) u->cur_image = u->GetImage(u->direction);
+
/* update crossing we were approaching */
if (crossing != INVALID_TILE) UpdateLevelCrossing(crossing);