From 7a37220881c995f317bf5bd0f3077fa6c9e9d098 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 May 2009 20:22:20 +0000 Subject: (svn r16390) -Codechange: move u.road to RoadVehicle. --- src/articulated_vehicles.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/articulated_vehicles.cpp') diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp index 43cb29c58..33259ebb4 100644 --- a/src/articulated_vehicles.cpp +++ b/src/articulated_vehicles.cpp @@ -327,28 +327,30 @@ void AddArticulatedParts(Vehicle *first, VehicleType type) SetArticulatedPart(u); break; - case VEH_ROAD: - u = new RoadVehicle(); - u->subtype = 0; + case VEH_ROAD: { + RoadVehicle *front = (RoadVehicle *)v; + RoadVehicle *rv = new RoadVehicle(); + rv->subtype = 0; previous->SetNext(u); - u->u.road.first_engine = v->engine_type; - u->u.road.cached_veh_length = 8; // Callback is called when the consist is finished - u->u.road.state = RVSB_IN_DEPOT; + rv->first_engine = front->engine_type; + rv->cached_veh_length = 8; // Callback is called when the consist is finished + rv->state = RVSB_IN_DEPOT; - u->u.road.roadtype = v->u.road.roadtype; - u->u.road.compatible_roadtypes = v->u.road.compatible_roadtypes; + rv->roadtype = front->roadtype; + rv->compatible_roadtypes = front->compatible_roadtypes; - u->spritenum = e_artic->u.road.image_index; + rv->spritenum = e_artic->image_index; if (e_artic->CanCarryCargo()) { - u->cargo_type = e_artic->GetDefaultCargoType(); - u->cargo_cap = e_artic->u.road.capacity; // Callback 36 is called when the consist is finished + rv->cargo_type = e_artic->GetDefaultCargoType(); + rv->cargo_cap = e_artic->u.road.capacity; // Callback 36 is called when the consist is finished } else { - u->cargo_type = v->cargo_type; // Needed for livery selection - u->cargo_cap = 0; + rv->cargo_type = front->cargo_type; // Needed for livery selection + rv->cargo_cap = 0; } - SetRoadVehArticPart(u); - break; + SetRoadVehArticPart(rv); + u = rv; + } break; } /* get common values from first engine */ -- cgit v1.2.3-54-g00ecf