summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-06-22 08:01:38 +0000
committerrubidium <rubidium@openttd.org>2010-06-22 08:01:38 +0000
commit9582da99c0db5e46624d23705d8cf7bb9d8df5a6 (patch)
treeeae0b5d9bc50cbd5c76be54f2d37a27c3c6ee1c3 /src
parente2445aca4abb404a5d37f6b5eed12ba73f4d66e4 (diff)
downloadopenttd-9582da99c0db5e46624d23705d8cf7bb9d8df5a6.tar.xz
(svn r20009) -Fix [FS#3893]: sign sorting was unstable
Diffstat (limited to 'src')
-rw-r--r--src/signs_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 5597a1202..237af085e 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -65,7 +65,9 @@ struct SignList {
GetString(buf_cache, STR_SIGN_NAME, lastof(buf_cache));
}
- return strcasecmp(buf, buf_cache);
+ int r = strcasecmp(buf, buf_cache);
+
+ return r != 0 ? r : ((*a)->index - (*b)->index);
}
void SortSignsList()