From e2df1d71d5ec39f89c540f116c1cb0b765a74229 Mon Sep 17 00:00:00 2001 From: hackykid Date: Tue, 21 Jun 2005 14:50:08 +0000 Subject: (svn r2467) - Fix: [newgrf] Prevent trains with shorter wagons breaking apart when reversing in some cases. (Therax) --- train_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train_cmd.c b/train_cmd.c index 414c34b43..9b5192e61 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -2643,7 +2643,7 @@ static void *CheckVehicleAtSignal(Vehicle *v, void *data) 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 @@ static void TrainController(Vehicle *v) 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) { -- cgit v1.2.3-70-g09d2