From dde4761e9d8dc5b7d8524286349a19ea3eb9e6eb Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 23 Apr 2023 11:59:58 +0100 Subject: [PATCH] Fix: Violation of strict weak ordering in engine value/running cost sorter --- src/build_vehicle_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 47b5c8276b..4015639bb9 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -418,7 +418,7 @@ static bool GenericEngineValueVsRunningCostSorter(const GUIEngineListItem &a, co * since we want consistent sorting. * Also if both have no power then sort with reverse of running cost to simulate * previous sorting behaviour for wagons. */ - if (v_a == 0 && v_b == 0) return !EngineRunningCostSorter(a, b); + if (v_a == 0 && v_b == 0) return EngineRunningCostSorter(b, a); if (v_a == v_b) return EngineNumberSorter(a, b); return _engine_sort_direction != (v_a < v_b); }