From 1d619d10f213b3d74b58fde1046c6b2a6e630b89 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 3 Jun 2023 14:24:39 +0100 Subject: [PATCH] Add Podium level to Stereo Mode - LF2_HIDEINMENU is considered equivalent to LF2_FINISHNEEDED for: - S_SoundTestDefLocked - So you don't see podium stuff without having beaten a GP - MV_FINISHNEEDED - So the status is saved to gamedata and persists between launches if custom - G_UpdateVisited is now called in K_FinishCeremony, so level is marked as beaten --- src/g_game.c | 4 ++-- src/g_game.h | 2 ++ src/k_podium.c | 6 +++--- src/s_sound.c | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index f8d08183f..d9d7378a2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3972,7 +3972,7 @@ void G_AddMapToBuffer(UINT16 map) // // G_UpdateVisited // -static void G_UpdateVisited(void) +void G_UpdateVisited(void) { UINT8 i; UINT8 earnedEmblems; @@ -5574,7 +5574,7 @@ void G_SaveGameData(void) UINT8 mapvisitedtemp = (mapheaderinfo[i]->records.mapvisited & MV_MAX); - if ((mapheaderinfo[i]->menuflags & LF2_FINISHNEEDED)) + if ((mapheaderinfo[i]->menuflags & (LF2_FINISHNEEDED|LF2_HIDEINMENU))) { mapvisitedtemp |= MV_FINISHNEEDED; } diff --git a/src/g_game.h b/src/g_game.h index 2f498134e..a8ba57e5e 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -281,6 +281,8 @@ INT16 G_GetFirstMapOfGametype(UINT8 pgametype); UINT16 G_RandMap(UINT32 tolflags, UINT16 pprevmap, boolean ignoreBuffers, boolean callAgainSoon, UINT16 *extBuffer); void G_AddMapToBuffer(UINT16 map); +void G_UpdateVisited(void); + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/k_podium.c b/src/k_podium.c index 480f3358c..7b2a6eb0b 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -291,9 +291,9 @@ void K_FinishCeremony(void) podiumData.ranking = true; - // Play the noise now - M_UpdateUnlockablesAndExtraEmblems(true, true); - G_SaveGameData(); + // Play the noise now (via G_UpdateVisited's concluding gamedata save) + prevmap = gamemap-1; + G_UpdateVisited(); } /*-------------------------------------------------- diff --git a/src/s_sound.c b/src/s_sound.c index 9a2fbe466..966a61623 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1533,7 +1533,7 @@ static boolean S_SoundTestDefLocked(musicdef_t *def) return false; // Is the level tied to SP progression? - if ((mapheaderinfo[def->sequence.map]->menuflags & LF2_FINISHNEEDED) + if ((mapheaderinfo[def->sequence.map]->menuflags & (LF2_FINISHNEEDED|LF2_HIDEINMENU)) && !(mapheaderinfo[def->sequence.map]->records.mapvisited & MV_BEATEN)) return true;