From 4d78d67d979cf131f9cad67e9d7bcfb23a509e9c Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 23 Oct 2018 21:49:23 +0200 Subject: [PATCH] prevent disabling the pure filter in the standard browserfilter --- src/game/client/components/menus_browser.cpp | 2 ++ src/game/client/components/menus_popups.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 1ea2b1d5e..cd6093a7e 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -192,6 +192,8 @@ void CMenus::LoadFilters() // add filter m_lFilters.add(CBrowserFilter(Type, pName, ServerBrowser(), 0, 999, -1, "", "")); + if(Type == CBrowserFilter::FILTER_STANDARD) // make sure the pure filter is enabled in the Teeworlds-filter + FilterInfo.m_SortHash |= IServerBrowser::FILTER_PURE; m_lFilters[i].SetFilter(&FilterInfo); } diff --git a/src/game/client/components/menus_popups.cpp b/src/game/client/components/menus_popups.cpp index 59e9f404f..68d7c58c7 100644 --- a/src/game/client/components/menus_popups.cpp +++ b/src/game/client/components/menus_popups.cpp @@ -139,7 +139,7 @@ int CMenus::PopupFilter(CMenus *pMenus, CUIRect View) ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter); static int s_BrFilterPure = 0; - if(pMenus->DoButton_CheckBox(&s_BrFilterPure, Localize("Standard gametype"), FilterInfo.m_SortHash&IServerBrowser::FILTER_PURE, &Button)) + if(pMenus->DoButton_CheckBox(&s_BrFilterPure, Localize("Standard gametype"), FilterInfo.m_SortHash&IServerBrowser::FILTER_PURE, &Button) && pFilter->Custom() != CBrowserFilter::FILTER_STANDARD) NewSortHash = FilterInfo.m_SortHash^IServerBrowser::FILTER_PURE; ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);