From 2f82227d6e2da29e9d7257faad88c5d213a78488 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Thu, 28 Jun 2018 21:19:58 -0400 Subject: [PATCH] A minor tweak --- src/p_setup.c | 2 +- src/p_user.c | 50 ++++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index cf2ad8e11..0d646edcd 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2660,7 +2660,7 @@ boolean P_SetupLevel(boolean skipprecip) // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished // but we do still need the mapmusname to be changed if (leveltime < (starttime + (TICRATE/2))) - S_StopMusic(); + S_ChangeMusicInternal("kstart", false); //S_StopMusic(); // Let's fade to black here // But only if we didn't do the special stage wipe diff --git a/src/p_user.c b/src/p_user.c index 3570e78a8..409ba09f7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1165,38 +1165,40 @@ void P_RestoreMusic(player_t *player) S_SpeedMusic(1.0f); // SRB2kart - We have some different powers than vanilla, some of which tweak the music. - if (splitscreen != 0 && G_RaceGametype() - && (players[consoleplayer].exiting - || players[secondarydisplayplayer].exiting - || players[thirddisplayplayer].exiting - || players[fourthdisplayplayer].exiting)) - S_ChangeMusicInternal("karwin", true); - else if (splitscreen == 0 && G_RaceGametype() && player->exiting) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("karwin", true); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("karlos", true); - else - S_ChangeMusicInternal("karok", true); - } + // Event - Race Start + if (leveltime < (starttime + (TICRATE/2))) + S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + // Item - Grow + else if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) + S_ChangeMusicInternal("kgrow", true); + // Item - Invincibility + else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) + S_ChangeMusicInternal("kinvnc", false); else { - // Item - Grow - if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) - S_ChangeMusicInternal("kgrow", true); - // Item - Invincibility - else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) - S_ChangeMusicInternal("kinvnc", false); - else if (leveltime > (starttime + (TICRATE/2))) + // Event - Race Finish + if (splitscreen != 0 && G_RaceGametype() + && (players[consoleplayer].exiting + || players[secondarydisplayplayer].exiting + || players[thirddisplayplayer].exiting + || players[fourthdisplayplayer].exiting)) + S_ChangeMusicInternal("karwin", true); + else if (splitscreen == 0 && G_RaceGametype() && player->exiting) + { + if (player->kartstuff[k_position] == 1) + S_ChangeMusicInternal("karwin", true); + else if (K_IsPlayerLosing(player)) + S_ChangeMusicInternal("karlos", true); + else + S_ChangeMusicInternal("karok", true); + } + else { // Event - Final Lap if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1)) S_SpeedMusic(1.2f); S_ChangeMusic(mapmusname, mapmusflags, true); } - else - S_StopMusic(); } }