diff options
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index f84f7b2b7..cfc67df61 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -71,7 +71,7 @@ static int CDECL EngineNumberSorter(const void *a, const void *b) { const EngineID va = *(const EngineID*)a; const EngineID vb = *(const EngineID*)b; - int r = va - vb; + int r = ListPositionOfEngine(va) - ListPositionOfEngine(vb); return _internal_sort_order ? -r : r; } @@ -193,15 +193,6 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void * return _internal_sort_order ? -r : r; } -static int CDECL TrainEngineNumberSorter(const void *a, const void *b) -{ - const EngineID va = *(const EngineID*)a; - const EngineID vb = *(const EngineID*)b; - int r = ListPositionOfEngine(va) - ListPositionOfEngine(vb); - - return _internal_sort_order ? -r : r; -} - static int CDECL TrainEngineCapacitySorter(const void *a, const void *b) { int va = RailVehInfo(*(const EngineID*)a)->capacity; @@ -381,7 +372,7 @@ static int CDECL AircraftEngineCargoSorter(const void *a, const void *b) static EngList_SortTypeFunction * const _sorter[][10] = {{ /* Trains */ - &TrainEngineNumberSorter, + &EngineNumberSorter, &TrainEngineCostSorter, &TrainEngineSpeedSorter, &TrainEnginePowerSorter, |