diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 22:22:46 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 22:22:46 +0000 |
commit | 80e94b9bb15f846189e98f1f457afe2b96ba2b58 (patch) | |
tree | b623c3e1cc75771986452340a138bd3ac60d4cbc /src/saveload/vehicle_sl.cpp | |
parent | 7a37220881c995f317bf5bd0f3077fa6c9e9d098 (diff) | |
download | openttd-80e94b9bb15f846189e98f1f457afe2b96ba2b58.tar.xz |
(svn r16391) -Codechange: use Train instead of Vehicle where appropriate.
Diffstat (limited to 'src/saveload/vehicle_sl.cpp')
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index 10b7f3614..6901bef4f 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -24,7 +24,7 @@ void ConnectMultiheadedTrains() FOR_ALL_VEHICLES(v) { if (v->type == VEH_TRAIN) { - v->u.rail.other_multiheaded_part = NULL; + ((Train *)v)->u.rail.other_multiheaded_part = NULL; } } @@ -45,7 +45,7 @@ void ConnectMultiheadedTrains() bool sequential_matching = IsFrontEngine(v); - for (Vehicle *u = v; u != NULL; u = GetNextVehicle(u)) { + for (Train *u = (Train *)v; u != NULL; u = (Train *)GetNextVehicle(u)) { if (u->u.rail.other_multiheaded_part != NULL) continue; // we already linked this one if (IsMultiheaded(u)) { @@ -57,7 +57,7 @@ void ConnectMultiheadedTrains() /* Find a matching back part */ EngineID eid = u->engine_type; - Vehicle *w; + Train *w; if (sequential_matching) { for (w = GetNextVehicle(u); w != NULL; w = GetNextVehicle(w)) { if (w->engine_type != eid || w->u.rail.other_multiheaded_part != NULL || !IsMultiheaded(w)) continue; @@ -318,8 +318,8 @@ void AfterLoadVehicles(bool part_of_load) assert(v->first != NULL); if (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v))) { - if (IsFrontEngine(v)) v->u.rail.last_speed = v->cur_speed; // update displayed train speed - TrainConsistChanged(v, false); + if (IsFrontEngine(v)) ((Train *)v)->u.rail.last_speed = v->cur_speed; // update displayed train speed + TrainConsistChanged((Train *)v, false); } else if (v->type == VEH_ROAD && IsRoadVehFront(v)) { RoadVehUpdateCache((RoadVehicle *)v); } |