diff options
author | rubidium <rubidium@openttd.org> | 2011-11-12 19:26:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-12 19:26:53 +0000 |
commit | aa668ba6bd054dd75ca44d75c2774a4a065b6a7f (patch) | |
tree | 72f698a1663e5edd83804aeb01752fe167e71682 /src/network | |
parent | 924a5e06b354b573412201e58bc95b39aabf2183 (diff) | |
download | openttd-aa668ba6bd054dd75ca44d75c2774a4a065b6a7f.tar.xz |
(svn r23202) -Fix [FS#4829]: unstable sorting in the network list when two servers had the exact same name
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_gui.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 1bdef4b55..03901e295 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -281,7 +281,8 @@ protected: /** Sort servers by name. */ static int CDECL NGameNameSorter(NetworkGameList * const *a, NetworkGameList * const *b) { - return strnatcmp((*a)->info.server_name, (*b)->info.server_name); // Sort by name (natural sorting). + int r = strnatcmp((*a)->info.server_name, (*b)->info.server_name); // Sort by name (natural sorting). + return r == 0 ? (*a)->address.CompareTo((*b)->address) : r; } /** |