diff --git a/src/k_kart.c b/src/k_kart.c index 66259332c..b0d8b3c40 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5469,11 +5469,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_UpdateInvincibilitySounds(player); // Also thanks, VAda! // Plays the music after the starting countdown. - if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2))) - { - S_ChangeMusic(mapmusname, mapmusflags, true); - S_ShowMusicCredit(); - } + if (P_IsLocalPlayer(player)) + M_Start(); } void K_KartPlayerAfterThink(player_t *player) @@ -6827,10 +6824,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) S_StartSound(NULL, sfx_s3ka7); if (leveltime == starttime) - { S_StartSound(NULL, sfx_s3kad); - S_StopMusic(); // The GO! sound stops the level start ambience - } } // Start charging once you're given the opportunity. diff --git a/src/p_user.c b/src/p_user.c index 312f9bb77..46f027652 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -703,10 +703,7 @@ void P_RestoreMusic(player_t *player) if (P_EndingMusic(player)) return; - // Event - Level Start - if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); - else // see also where time overs are handled - search for "lives = 2" in this file + if (leveltime > (starttime + (TICRATE/2))) { INT32 wantedmus = 0; // 0 is level music, 1 is invincibility, 2 is grow diff --git a/src/s_sound.c b/src/s_sound.c index b85ea9afe..ffe9f9e9e 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1966,13 +1966,28 @@ void S_Start(void) mapmusresume = 0; } - //if (cv_resetmusic.value) // Starting ambience should always be restarted - S_StopMusic(); + S_StopMusic(); if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart - S_ChangeMusicEx((encoremode ? "estart" : "kstart"), 0, false, mapmusposition, 0, 0); - else + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); + //S_ChangeMusicEx((encoremode ? "estart" : "kstart"), 0, false, mapmusposition, 0, 0); +} + +void M_Start(void) +{ + if (leveltime > (starttime + (TICRATE/2))) + return; + + // The GO! sound stops the level start ambience + if (leveltime == starttime) + S_StopMusic(); + + // Plays the music after the starting countdown. + if (leveltime == (starttime + (TICRATE/2))) + { S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); + S_ShowMusicCredit(); + } } void S_RestartMusic(void) diff --git a/src/s_sound.h b/src/s_sound.h index b88d1121e..474b22c3b 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -101,6 +101,7 @@ void S_InitSfxChannels(INT32 sfxVolume); void S_StopSounds(void); void S_ClearSfx(void); void S_Start(void); +void M_Start(void); // Stops music and restarts it from same position. Used for instant applying changes to amiga filters. void S_RestartMusic(void);