about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-31 21:22:12 +0200
committeroy <Tom_Adams@web.de>2011-03-31 21:22:12 +0200
commitb3ae1a088e2b1980cf6055a0fe787d6f3971ce9e (patch)
tree95c3a5e320dfa844a47dbb20c84b945bf1e9f874 /src/engine
parent98eaaf2e23a6b08c48c0dfdda6378df6e19eaed6 (diff)
downloadzcatch-b3ae1a088e2b1980cf6055a0fe787d6f3971ce9e.tar.gz
zcatch-b3ae1a088e2b1980cf6055a0fe787d6f3971ce9e.zip
make the "show friends"-filter just list servers with friends on them
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/serverbrowser.cpp7
-rw-r--r--src/engine/shared/config_variables.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/engine/client/serverbrowser.cpp b/src/engine/client/serverbrowser.cpp
index 36447922..13c4b32d 100644
--- a/src/engine/client/serverbrowser.cpp
+++ b/src/engine/client/serverbrowser.cpp
@@ -143,21 +143,20 @@ void CServerBrowser::Filter()
 	for(i = 0; i < m_NumServers; i++)
 	{
 		int Filtered = 0;
-		bool FoundFriend = false;
 
 		if(g_Config.m_BrFilterFriends)
 		{
+			Filtered = 1;
 			for(p = 0; p < m_ppServerlist[i]->m_Info.m_NumClients; p++)
 			{
 				if(m_pFriends->IsFriend(m_ppServerlist[i]->m_Info.m_aClients[p].m_aName, m_ppServerlist[i]->m_Info.m_aClients[p].m_aClan))
 				{
-					FoundFriend = true;
+					Filtered = 0;
 					break;
 				}
 			}
 		}
-
-		if(!FoundFriend)
+		else
 		{
 			if(g_Config.m_BrFilterEmpty && ((g_Config.m_BrFilterSpectators && m_ppServerlist[i]->m_Info.m_NumPlayers == 0) || m_ppServerlist[i]->m_Info.m_NumClients == 0))
 				Filtered = 1;
diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h
index 0e3dc8e3..c30edeaf 100644
--- a/src/engine/shared/config_variables.h
+++ b/src/engine/shared/config_variables.h
@@ -31,7 +31,7 @@ MACRO_CONFIG_STR(BrFilterString, br_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_
 MACRO_CONFIG_INT(BrFilterFull, br_filter_full, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out full server in browser")
 MACRO_CONFIG_INT(BrFilterEmpty, br_filter_empty, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out empty server in browser")
 MACRO_CONFIG_INT(BrFilterSpectators, br_filter_spectators, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out spectators from player numbers")
-MACRO_CONFIG_INT(BrFilterFriends, br_filter_friends, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Do not filter out servers with friends")
+MACRO_CONFIG_INT(BrFilterFriends, br_filter_friends, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out servers with no friends")
 MACRO_CONFIG_INT(BrFilterPw, br_filter_pw, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out password protected servers in browser")
 MACRO_CONFIG_INT(BrFilterPing, br_filter_ping, 999, 0, 999, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ping to filter by in the server browser")
 MACRO_CONFIG_STR(BrFilterGametype, br_filter_gametype, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Game types to filter")