Skip to content

Commit

Permalink
Fix server browser update on community filter change via console
Browse files Browse the repository at this point in the history
Also update server browser filtering/sorting when changing the community/country/type filter config variables with the console.

Clean the filter config variables when they are changed instead of only when the community filter is rendered.
  • Loading branch information
Robyt3 committed Nov 19, 2023
1 parent aba67f4 commit ccc470e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
// community filter
if((g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES) && !ServerBrowser()->Communities().empty())
{
ServerBrowser()->CleanFilters();

CUIRect Row;
View.HSplitTop(6.0f, nullptr, &View);
View.HSplitTop(19.0f, &Row, &View);
Expand Down Expand Up @@ -1742,8 +1740,13 @@ void CMenus::ConchainFavoritesUpdate(IConsole::IResult *pResult, void *pUserData
void CMenus::ConchainCommunitiesUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
{
pfnCallback(pResult, pCallbackUserData);
CMenus *pThis = static_cast<CMenus *>(pUserData);
if(pResult->NumArguments() >= 1 && (g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES))
((CMenus *)pUserData)->UpdateCommunityCache(true);
{
pThis->ServerBrowser()->CleanFilters();
pThis->UpdateCommunityCache(true);
pThis->Client()->ServerBrowserUpdate();
}
}

void CMenus::UpdateCommunityCache(bool Force)
Expand Down

0 comments on commit ccc470e

Please sign in to comment.