diff options
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 8032b24b3..259528f4a 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -854,9 +854,7 @@ static int CDECL VehicleLengthSorter(const Vehicle * const *a, const Vehicle * c break; case VEH_ROAD: { - const RoadVehicle *u; - for (u = RoadVehicle::From(*a); u != NULL; u = u->Next()) r += u->rcache.cached_veh_length; - for (u = RoadVehicle::From(*b); u != NULL; u = u->Next()) r -= u->rcache.cached_veh_length; + r = RoadVehicle::From(*a)->rcache.cached_total_length - RoadVehicle::From(*b)->rcache.cached_total_length; break; } |