(svn r2467) - Fix: [newgrf] Prevent trains with shorter wagons breaking apart when reversing in some cases. (Therax)
--- a/train_cmd.c Tue Jun 21 07:30:01 2005 +0000
+++ b/train_cmd.c Tue Jun 21 14:50:08 2005 +0000
@@ -2643,7 +2643,7 @@
static void TrainController(Vehicle *v)
{
- Vehicle *prev = NULL;
+ Vehicle *prev;
GetNewVehiclePosResult gp;
uint32 r, tracks,ts;
int i, enterdir, newdir, dir;
@@ -2652,7 +2652,7 @@
byte old_z;
/* For every vehicle after and including the given vehicle */
- for (; v != NULL; prev = v, v = v->next) {
+ for (prev = GetPrevVehicleInChain(v); v != NULL; prev = v, v = v->next) {
BeginVehicleMove(v);
if (v->u.rail.track != 0x40) {