mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Merge pull request #7852 from Robyt3/Browser-Community-Filter-Fix
Fix countries/types filters excluding all servers
This commit is contained in:
commit
a2c8869025
|
@ -1569,8 +1569,8 @@ void CServerBrowser::CommunitiesFilterClean()
|
|||
void CServerBrowser::CountriesFilterClean()
|
||||
{
|
||||
std::vector<const char *> vpCountryNames;
|
||||
for(const auto &Community : Communities())
|
||||
for(const auto &Country : Community.Countries())
|
||||
for(const CCommunity *pCommunity : SelectedCommunities())
|
||||
for(const auto &Country : pCommunity->Countries())
|
||||
vpCountryNames.push_back(Country.Name());
|
||||
m_CountriesFilter.Clean(vpCountryNames);
|
||||
}
|
||||
|
@ -1578,8 +1578,8 @@ void CServerBrowser::CountriesFilterClean()
|
|||
void CServerBrowser::TypesFilterClean()
|
||||
{
|
||||
std::vector<const char *> vpTypeNames;
|
||||
for(const auto &Community : Communities())
|
||||
for(const auto &Type : Community.Types())
|
||||
for(const CCommunity *pCommunity : SelectedCommunities())
|
||||
for(const auto &Type : pCommunity->Types())
|
||||
vpTypeNames.push_back(Type.Name());
|
||||
m_TypesFilter.Clean(vpTypeNames);
|
||||
}
|
||||
|
|
|
@ -1743,7 +1743,6 @@ void CMenus::ConchainCommunitiesUpdate(IConsole::IResult *pResult, void *pUserDa
|
|||
CMenus *pThis = static_cast<CMenus *>(pUserData);
|
||||
if(pResult->NumArguments() >= 1 && (g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES))
|
||||
{
|
||||
pThis->ServerBrowser()->CleanFilters();
|
||||
pThis->UpdateCommunityCache(true);
|
||||
pThis->Client()->ServerBrowserUpdate();
|
||||
}
|
||||
|
@ -1755,6 +1754,8 @@ void CMenus::UpdateCommunityCache(bool Force)
|
|||
if(!Force && m_CommunityCache.m_UpdateTime != 0 && m_CommunityCache.m_UpdateTime == ServerBrowser()->DDNetInfoUpdateTime() && m_CommunityCache.m_PageWithCommunities == PageWithCommunities)
|
||||
return;
|
||||
|
||||
ServerBrowser()->CleanFilters();
|
||||
|
||||
m_CommunityCache.m_UpdateTime = ServerBrowser()->DDNetInfoUpdateTime();
|
||||
m_CommunityCache.m_PageWithCommunities = PageWithCommunities;
|
||||
|
||||
|
|
Loading…
Reference in a new issue