changeset 12005:68a3fa1a250f draft

(svn r16411) -Fix (r16390): Building articulated roadvehicles caused infinite loop due to v->Next() pointing to v itself.
author frosch <frosch@openttd.org>
date Sun, 24 May 2009 11:39:35 +0000
parents c2d9b54aaa63
children 6a32d73fd4be
files src/articulated_vehicles.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -333,7 +333,7 @@
 				RoadVehicle *front = (RoadVehicle *)v;
 				RoadVehicle *rv = new RoadVehicle();
 				rv->subtype = 0;
-				previous->SetNext(u);
+				previous->SetNext(rv);
 				rv->rcache.first_engine = front->engine_type;
 				rv->rcache.cached_veh_length = 8; // Callback is called when the consist is finished
 				rv->state = RVSB_IN_DEPOT;