Merge branch 'unlock-trigger-fix' into 'next'

Update unlockables before level load executors

See merge request STJr/SRB2!2289
This commit is contained in:
sphere 2024-02-04 21:33:02 +00:00
commit 233949789e

View file

@ -7913,6 +7913,24 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (!P_LoadMapFromFile())
return false;
if (!demoplayback)
{
clientGamedata->mapvisited[gamemap-1] |= MV_VISITED;
serverGamedata->mapvisited[gamemap-1] |= MV_VISITED;
M_SilentUpdateUnlockablesAndEmblems(serverGamedata);
if (M_UpdateUnlockablesAndExtraEmblems(clientGamedata))
{
S_StartSound(NULL, sfx_s3k68);
G_SaveGameData(clientGamedata);
}
else if (!reloadinggamestate)
{
G_SaveGameData(clientGamedata);
}
}
// init anything that P_SpawnSlopes/P_LoadThings needs to know
P_InitSpecials();
@ -7971,24 +7989,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
nextmapoverride = 0;
skipstats = 0;
if (!demoplayback)
{
clientGamedata->mapvisited[gamemap-1] |= MV_VISITED;
serverGamedata->mapvisited[gamemap-1] |= MV_VISITED;
M_SilentUpdateUnlockablesAndEmblems(serverGamedata);
if (M_UpdateUnlockablesAndExtraEmblems(clientGamedata))
{
S_StartSound(NULL, sfx_s3k68);
G_SaveGameData(clientGamedata);
}
else if (!reloadinggamestate)
{
G_SaveGameData(clientGamedata);
}
}
levelloading = false;
P_RunCachedActions();