summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-30 17:19:58 +0000
committerbjarni <bjarni@openttd.org>2007-01-30 17:19:58 +0000
commitbe19961f1ebbc7e97aee8dcfa757d828a90c470c (patch)
tree65ec6aca3f47ae1a4bfaea6bfc58edc76b1d4197
parent291b7925ee2fd9b7e16a521a08a5dc6689668984 (diff)
downloadopenttd-be19961f1ebbc7e97aee8dcfa757d828a90c470c.tar.xz
(svn r8460) -Fix (r8455): the build train window put locomotives and wagons in appeantly random order
-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 */