Clear menus if wiping from GS_MENU to GS_LEVEL/GSWAITINGPLAYERS

Catches a case that's never been relevant before -- now that you can open the console on the menu, map commands have newfound dangers to be worked around.
This commit is contained in:
toaster 2022-09-02 22:37:40 +01:00
parent 1aabde7d4f
commit cf25cf0da1
2 changed files with 4 additions and 0 deletions

View file

@ -1999,6 +1999,8 @@ static void CL_ConnectToServer(void)
DEBFILE(va("waiting %d nodes\n", doomcom->numnodes));
G_SetGamestate(GS_WAITINGPLAYERS);
if (wipegamestate == GS_MENU)
M_ClearMenus(true);
wipegamestate = GS_WAITINGPLAYERS;
ClearAdminPlayers();

View file

@ -1286,6 +1286,8 @@ void G_DoLoadLevel(boolean resetplayer)
titlemapinaction = TITLEMAP_OFF;
G_SetGamestate(GS_LEVEL);
if (wipegamestate == GS_MENU)
M_ClearMenus(true);
I_UpdateMouseGrab();
for (i = 0; i < MAXPLAYERS; i++)