Changeset - r24717:c35921991883
[Not reviewed]
master
0 1 0
Patric Stout - 4 years ago 2021-01-31 09:36:07
truebrain@openttd.org
Fix 2db88953: default Network Server List sorter put compatible servers in wrong order (#8626)

If a server is compatible, it falls back to sorting by clients.
This used to be in reverse, so full servers are on top. With
the codechange commit, this was removed by accident, and as
such empty servers were on top. This is silly.
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/network/network_gui.cpp
Show inline comments
 
@@ -327,16 +327,15 @@ protected:
 
		/* Reverse default as we are interested in version-compatible clients first */
 
		if (r == 0) r = b->info.version_compatible - a->info.version_compatible;
 
		/* The version-compatible ones are then sorted with NewGRF compatible first, incompatible last */
 
		if (r == 0) r = b->info.compatible - a->info.compatible;
 
		/* Passworded servers should be below unpassworded servers */
 
		if (r == 0) r = a->info.use_password - b->info.use_password;
 
		/* Finally sort on the number of clients of the server */
 
		if (r == 0) return NGameClientSorter(a, b);
 

	
 
		return r < 0;
 
		/* Finally sort on the number of clients of the server in reverse order. */
 
		return (r != 0) ? r < 0: !NGameClientSorter(a, b);
 
	}
 

	
 
	/** Sort the server list */
 
	void SortNetworkGameList()
 
	{
 
		if (this->servers.Sort()) this->UpdateListPos();
0 comments (0 inline, 0 general)