sort empty servers to the end of the list

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2694 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2008-09-18 18:48:35 +00:00
parent 71d966bd63
commit 60ec9e1bf0
+2 -2
View File
@@ -457,10 +457,10 @@ int sicompare(serverinfo **ap, serverinfo **bp)
serverinfo *a = *ap, *b = *bp;
if((a->protocol==PROTOCOL_VERSION) > (b->protocol==PROTOCOL_VERSION)) return -1;
if((b->protocol==PROTOCOL_VERSION) > (a->protocol==PROTOCOL_VERSION)) return 1;
if(a->numplayers == 0 && b->numplayers > 0) return 1;
if(a->numplayers > 0 && b->numplayers == 0) return -1;
if(a->ping>b->ping) return 1;
if(a->ping<b->ping) return -1;
if(a->numplayers<b->numplayers) return 1;
if(a->numplayers>b->numplayers) return -1;
int namecmp = strcmp(a->name, b->name);
if(namecmp) return namecmp;
if(a->port>b->port) return 1;