From c9efaf3a1a036493e8bc3e7f1c576973a7e61d46 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 1 Aug 2023 17:52:06 +0100 Subject: [PATCH] fix warping from SP pause level select breaking if game was started with no save slot (such as from extras menu) --- src/m_menu.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index e10bb7547..3451b90d6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7112,8 +7112,22 @@ static void M_LevelSelectWarp(INT32 choice) fromlevelselect = true; if (currentMenu == &SP_LevelSelectDef || currentMenu == &SP_PauseLevelSelectDef) - G_LoadGame((UINT32)cursaveslot, startmap); // reload from SP save data: this is needed to keep score/lives/continues from reverting to defaults - else + { + if (cursaveslot > 0) // do we have a save slot to load? + G_LoadGame((UINT32)cursaveslot, startmap); // reload from SP save data: this is needed to keep score/lives/continues from reverting to defaults + else // no save slot, start new game but keep the current skin + { + M_ClearMenus(true); + + G_DeferedInitNew(false, G_BuildMapName(startmap), cv_skin.value, false, fromlevelselect); // Not sure about using cv_skin here, but it seems fine in testing. + COM_BufAddText("dummyconsvar 1\n"); // G_DeferedInitNew doesn't do this + + if (levelselect.rows) + Z_Free(levelselect.rows); + levelselect.rows = NULL; + } + } + else // start new game { cursaveslot = 0; M_SetupChoosePlayer(0);