diff options
author | terkhen <terkhen@openttd.org> | 2010-11-06 13:05:11 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-11-06 13:05:11 +0000 |
commit | 18e3a3ddfc7c9eee4d1023485a4c23b3cc40fbb3 (patch) | |
tree | 719e279d32005d7032a509a6aea06ab70124a667 /src/vehicle_gui.cpp | |
parent | 25d1b2f54b9cac01e2737848c208f6d8096a4a92 (diff) | |
download | openttd-18e3a3ddfc7c9eee4d1023485a4c23b3cc40fbb3.tar.xz |
(svn r21099) -Codechange: Store road vehicle max speed in the vehicle cache.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 7adacc88c..a5215f914 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -806,12 +806,7 @@ static int CDECL VehicleReliabilitySorter(const Vehicle * const *a, const Vehicl /** Sort vehicles by their max speed */ static int CDECL VehicleMaxSpeedSorter(const Vehicle * const *a, const Vehicle * const *b) { - int r = 0; - if ((*a)->type != VEH_ROAD && (*b)->type != VEH_ROAD) { - r = (*a)->vcache.cached_max_speed - (*b)->vcache.cached_max_speed; - } else { - r = (*a)->max_speed - (*b)->max_speed; - } + int r = (*a)->vcache.cached_max_speed - (*b)->vcache.cached_max_speed; return (r != 0) ? r : VehicleNumberSorter(a, b); } |