diff --git a/src/p_setup.c b/src/p_setup.c index 3d375e215c0fb81624a82e14e2127527da025aa4..dc93fd2fee7541ab0d4dc5324726de8e6fdddaf1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2725,19 +2725,20 @@ boolean P_SetupLevel(boolean skipprecip) S_StopSounds(); S_ClearSfx(); + // Fade out music here. Deduct 2 tics so the fade volume actually reaches 0. + // But don't halt the music! S_Start will take care of that. This dodges a MIDI crash bug. + if (cv_resetmusic.value || + strnicmp(S_MusicName(), + (mapmusflags & MUSIC_RELOADRESET) ? mapheaderinfo[gamemap-1]->musname : mapmusname, 7)) + S_FadeMusic(0, FixedMul( + FixedDiv((F_GetWipeLength(wipedefs[wipe_level_toblack])-2)*NEWTICRATERATIO, NEWTICRATE), MUSICRATE)); + if (!titlemapinaction) { // Let's fade to black here // But only if we didn't do the special stage wipe if (rendermode != render_none && !ranspecialwipe) { - // Fade out music here. Deduct 2 tics so the fade volume actually reaches 0 - if (cv_resetmusic.value || - strnicmp(S_MusicName(), - (mapmusflags & MUSIC_RELOADRESET) ? mapheaderinfo[gamemap-1]->musname : mapmusname, 7)) - S_FadeOutStopMusic(FixedMul( - FixedDiv((F_GetWipeLength(wipedefs[wipe_level_toblack])-2)*NEWTICRATERATIO, NEWTICRATE), MUSICRATE)); - F_WipeStartScreen(); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); @@ -2745,10 +2746,6 @@ boolean P_SetupLevel(boolean skipprecip) F_RunWipe(wipedefs[wipe_level_toblack], false); } - // As oddly named as this is, this handles music only. - // We should be fine starting it here. - S_Start(); - if (ranspecialwipe == 2) { pausedelay = -3; // preticker plus one @@ -2770,6 +2767,10 @@ boolean P_SetupLevel(boolean skipprecip) } } + // As oddly named as this is, this handles music only. + // We should be fine starting it here. + S_Start(); + levelfadecol = (ranspecialwipe) ? 0 : 31; // Close text prompt before freeing the old level