summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-12 19:26:53 +0000
committerrubidium <rubidium@openttd.org>2011-11-12 19:26:53 +0000
commitaa668ba6bd054dd75ca44d75c2774a4a065b6a7f (patch)
tree72f698a1663e5edd83804aeb01752fe167e71682 /src/network
parent924a5e06b354b573412201e58bc95b39aabf2183 (diff)
downloadopenttd-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.cpp3
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;
}
/**