summaryrefslogtreecommitdiff
path: root/src/saveload/vehicle_sl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/vehicle_sl.cpp')
-rw-r--r--src/saveload/vehicle_sl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index b08d373d2..10d7d3c9c 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -314,8 +314,11 @@ void AfterLoadVehicles(bool part_of_load)
t->tcache.last_speed = t->cur_speed; // update displayed train speed
TrainConsistChanged(t, false);
}
- } else if (v->type == VEH_ROAD && IsRoadVehFront(v)) {
- RoadVehUpdateCache(RoadVehicle::From(v));
+ } else if (v->type == VEH_ROAD) {
+ RoadVehicle *rv = RoadVehicle::From(v);
+ if (rv->IsRoadVehFront()) {
+ RoadVehUpdateCache(rv);
+ }
}
}