Changeset - r27132:d261ec182950
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 14 months ago 2023-04-23 10:59:58
j.g.rennison@gmail.com
Fix: Violation of strict weak ordering in engine value/running cost sorter
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -300,7 +300,7 @@ static bool EnginePowerVsRunningCostSort
 
	 * 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);
 
}
0 comments (0 inline, 0 general)