From 5a4e3b1c2dd81baa16068646b97e466aa6b490f2 Mon Sep 17 00:00:00 2001 From: furo Date: Wed, 20 Sep 2023 18:32:34 +0200 Subject: [PATCH] Update server browser when adding friends from ingame. --- src/game/client/components/menus_browser.cpp | 7 ++++--- src/game/client/components/menus_ingame.cpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 43d45f15b..7a0516d27 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -1661,10 +1661,11 @@ CTeeRenderInfo CMenus::GetTeeRenderInfo(vec2 Size, const char *pSkinName, bool C void CMenus::ConchainFriendlistUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) { pfnCallback(pResult, pCallbackUserData); - if(pResult->NumArguments() >= 1 && ((CMenus *)pUserData)->Client()->State() == IClient::STATE_OFFLINE) + CMenus *pThis = ((CMenus *)pUserData); + if(pResult->NumArguments() >= 1 && (pThis->Client()->State() == IClient::STATE_OFFLINE || pThis->Client()->State() == IClient::STATE_ONLINE)) { - ((CMenus *)pUserData)->FriendlistOnUpdate(); - ((CMenus *)pUserData)->Client()->ServerBrowserUpdate(); + pThis->FriendlistOnUpdate(); + pThis->Client()->ServerBrowserUpdate(); } } diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index c4b7235ff..07dee4a30 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -349,6 +349,8 @@ void CMenus::RenderPlayers(CUIRect MainView) m_pClient->Friends()->RemoveFriend(CurrentClient.m_aName, CurrentClient.m_aClan); else m_pClient->Friends()->AddFriend(CurrentClient.m_aName, CurrentClient.m_aClan); + + m_pClient->Client()->ServerBrowserUpdate(); } }