From cf25cf0da15975f1f849fa3ec2623b999ffbe241 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 2 Sep 2022 22:37:40 +0100 Subject: [PATCH] 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. --- src/d_clisrv.c | 2 ++ src/g_game.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7f9c2ef21..13d0a67d6 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -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(); diff --git a/src/g_game.c b/src/g_game.c index 31b5b2d15..9760197b9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -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++)