diff options
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b0ad68113..e8b1e4093 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -275,8 +275,17 @@ void AfterLoadVehicles(bool clear_te_id) } FOR_ALL_VEHICLES(v) { - assert(v->First() != NULL); + 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); + } else if (v->type == VEH_ROAD && IsRoadVehFront(v)) { + RoadVehUpdateCache(v); + } + } + + FOR_ALL_VEHICLES(v) { switch (v->type) { case VEH_ROAD: v->u.road.roadtype = HasBit(EngInfo(v->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD; @@ -312,19 +321,6 @@ void AfterLoadVehicles(bool clear_te_id) } } -void InitializeVehicleCaches() -{ - Vehicle *v; - FOR_ALL_VEHICLES(v) { - 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); - } else if (v->type == VEH_ROAD && IsRoadVehFront(v)) { - RoadVehUpdateCache(v); - } - } -} - Vehicle::Vehicle() { this->type = VEH_INVALID; |