Hacky way to join tutorial from LAN

This commit is contained in:
Dennis Felsing 2022-03-24 16:14:54 +01:00
parent ebd76d9db5
commit 3ee8d880fe

View file

@ -30,6 +30,8 @@
#include <engine/external/json-parser/json.h>
#include <game/client/components/menus.h> // PAGE_DDNET
class SortWrap
{
typedef bool (CServerBrowser::*SortFunc)(int, int) const;
@ -1522,6 +1524,11 @@ void CServerBrowser::LoadDDNetInfoJson()
const char *CServerBrowser::GetTutorialServer()
{
// Use DDNet tab as default after joining tutorial, also makes sure Find() actually works
// Note that when no server info has been loaded yet, this will not return a result immediately.
g_Config.m_UiPage = CMenus::PAGE_DDNET;
Refresh(IServerBrowser::TYPE_DDNET);
CNetwork *pNetwork = &m_aNetworks[NETWORK_DDNET];
const char *pBestAddr = nullptr;
int BestLatency = std::numeric_limits<int>::max();