From 10c18fe3fabdcf7b8f61b1bd02fc7e120435f239 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 3 Jun 2023 14:20:48 +0100 Subject: [PATCH] Podium Music Uses the multiple alt music options of the podium map's level header in a specific sequence, so it can slot in to the Stereo Mode music list natively, and so custom Podiums don't have to replace existing tracks to function. --- src/k_podium.c | 15 +++++++++++++++ src/p_setup.c | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/k_podium.c b/src/k_podium.c index ae1d45eef..480f3358c 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -316,6 +316,21 @@ void K_ResetCeremony(void) podiumData.rank = grandprixinfo.rank; podiumData.grade = K_CalculateGPGrade(&podiumData.rank); + // Set up music for podium. + { + if (podiumData.rank.position == 1) + mapmusrng = 2; + else if (podiumData.rank.position <= 3) + mapmusrng = 1; + else + mapmusrng = 0; + + if (mapmusrng >= mapheaderinfo[gamemap-1]->musname_size) + mapmusrng = 0; + + mapmusflags |= MUSIC_RELOADRESET; + } + if (!grandprixinfo.cup) { return; diff --git a/src/p_setup.c b/src/p_setup.c index ea1185a67..c38aef02b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8075,7 +8075,14 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) S_FadeMusic(0, FixedMul( FixedDiv((F_GetWipeLength(wipedefs[wipe_level_toblack])-2)*NEWTICRATERATIO, NEWTICRATE), MUSICRATE)); - if (!(reloadinggamestate || gamestate != GS_LEVEL)) + if (reloadinggamestate) + ; + else if (K_PodiumSequence()) + { + // mapmusrng is set by local player position in K_ResetCeremony + S_InitLevelMusic(true); + } + else if (gamestate == GS_LEVEL) { if (ranspecialwipe == 2) {