M_StartControlPanel: Guarantee titlemap contexts have internal server stopped when entering menu

Guarantees netUnlocked is correctly updated in most contexts, since that's dependent on SV_ResetServer, which isn't called if a server is running
Also guarantees titlemapinaction isn't true during regular play
This commit is contained in:
toaster 2024-03-18 20:22:23 +00:00
parent b7825dba88
commit 32afe48aab
2 changed files with 9 additions and 0 deletions

View file

@ -3927,6 +3927,7 @@ void SV_StopServer(void)
maketic = gametic+1;
neededtic = maketic;
serverrunning = false;
titlemapinaction = false;
}
// called at singleplayer start and stopdemo

View file

@ -726,6 +726,14 @@ void M_StartControlPanel(void)
{
if (gamestate != GS_MENU)
{
if (titlemapinaction)
{
// We clear a LITTLE bit of state, but not a full D_ClearState.
// Just enough to guarantee SV_ResetServer is called before session start.
SV_StopServer();
SV_ResetServer();
}
G_SetGamestate(GS_MENU);
gameaction = ga_nothing;