...you know what, just call G_LoadGame for SP_PauseLevelSelectDef in M_LevelSelectWarp too

This commit is contained in:
Monster Iestyn 2023-07-31 23:36:07 +01:00
parent 77d70aaa1b
commit fb00b65f41

View file

@ -7100,9 +7100,6 @@ static void M_DestroyRobots(INT32 choice)
static void M_LevelSelectWarp(INT32 choice) static void M_LevelSelectWarp(INT32 choice)
{ {
boolean fromloadgame = (currentMenu == &SP_LevelSelectDef);
boolean frompause = (currentMenu == &SP_PauseLevelSelectDef);
(void)choice; (void)choice;
if (W_CheckNumForName(G_BuildMapName(cv_nextmap.value)) == LUMPERROR) if (W_CheckNumForName(G_BuildMapName(cv_nextmap.value)) == LUMPERROR)
@ -7114,24 +7111,11 @@ static void M_LevelSelectWarp(INT32 choice)
startmap = (INT16)(cv_nextmap.value); startmap = (INT16)(cv_nextmap.value);
fromlevelselect = true; fromlevelselect = true;
if (fromloadgame) if (currentMenu == &SP_LevelSelectDef || currentMenu == &SP_PauseLevelSelectDef)
G_LoadGame((UINT32)cursaveslot, startmap); G_LoadGame((UINT32)cursaveslot, startmap); // reload from SP save data: this is needed to keep score/lives/continues from reverting to defaults
else else
{ {
cursaveslot = 0; cursaveslot = 0;
if (frompause)
{
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
M_SetupChoosePlayer(0); M_SetupChoosePlayer(0);
} }
} }