summaryrefslogtreecommitdiff
path: root/src/articulated_vehicles.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 20:22:20 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 20:22:20 +0000
commit7a37220881c995f317bf5bd0f3077fa6c9e9d098 (patch)
tree347d24d175af30acacfedfb4ddf5c9e98d876036 /src/articulated_vehicles.cpp
parentd37b840cf30ea987ab676f1a3631e112cac06244 (diff)
downloadopenttd-7a37220881c995f317bf5bd0f3077fa6c9e9d098.tar.xz
(svn r16390) -Codechange: move u.road to RoadVehicle.
Diffstat (limited to 'src/articulated_vehicles.cpp')
-rw-r--r--src/articulated_vehicles.cpp32
1 files changed, 17 insertions, 15 deletions
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 */