summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/build_vehicle_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 3cee1a0ef..5c077a6ad 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -228,8 +228,8 @@ static int CDECL TrainEnginesThenWagonsSorter(const void *a, const void *b)
{
EngineID va = *(const EngineID*)a;
EngineID vb = *(const EngineID*)b;
- int val_a = (RailVehInfo(va)->railveh_type != RAILVEH_WAGON ? 1 : 0);
- int val_b = (RailVehInfo(vb)->railveh_type != RAILVEH_WAGON ? 1 : 0);
+ int val_a = (RailVehInfo(va)->railveh_type == RAILVEH_WAGON ? 1 : 0);
+ int val_b = (RailVehInfo(vb)->railveh_type == RAILVEH_WAGON ? 1 : 0);
int r = val_a - val_b;
/* Use EngineID to sort instead since we want consistent sorting */