Clear serverlistultimatecount when leaving Server Browser for any reason

This is the easiest existing tracked variable to ensure matches 1:1 to "you are joining a netgame from the Server Browser".
This commit is contained in:
toaster 2023-09-02 16:58:19 +01:00
parent 428fa11231
commit 5c1f5f1824
2 changed files with 9 additions and 1 deletions

View file

@ -987,6 +987,7 @@ void D_ClearState(void)
// (otherwise the game still thinks we're playing!)
SV_StopServer();
SV_ResetServer();
serverlistultimatecount = 0;
for (i = 0; i < MAXPLAYERS; i++)
CL_ClearPlayer(i);

View file

@ -13,6 +13,13 @@
void M_ServerListFillDebug(void);
#endif
// Quit
static boolean M_ServerBrowserQuit(void)
{
serverlistultimatecount = 0;
return true;
}
menuitem_t PLAY_MP_ServerBrowser[] =
{
@ -38,7 +45,7 @@ menu_t PLAY_MP_ServerBrowserDef = {
M_DrawMPServerBrowser,
M_MPServerBrowserTick,
NULL,
NULL,
M_ServerBrowserQuit,
M_ServerBrowserInputs
};