mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r12332) -Fix (r12331): Invalidate cached data and update image after setting flag.
This commit is contained in:
parent
b64f637c72
commit
6bb37edfb6
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user