From 403b60240f0223bb7d8a7b43dda12c3dad95ba2d Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 26 Nov 2024 05:33:00 +0100 Subject: [PATCH] check for titlescreen music --- src/s_sound.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 868bccc77..0a6a5ba0c 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2191,11 +2191,11 @@ static boolean oldencore = false; static boolean skipmusic = false; boolean skipintromus = false; -static const char *musicexception_list[16] = { +static const char *musicexception_list[17] = { "vote", "voteea", "voteeb", "racent", "krwin", "krok", "krlose", "krfail", "kbwin", "kbok", - "kblose", "kstart", "estart", "wait2j", "CHRSHP", - "CHRSHF" + "kblose", "kstart", "estart", "wait2j", "titles", + "CHRSHF", "CHRSHP" // no clue what those are tbh }; //checks for any kind of event music like intermission, vote etc. @@ -2207,7 +2207,7 @@ static void S_CheckEventMus(const char *newmus) if (!cv_keepmusic.value) return; - for (int i = 0; i < 16; i++) + for (int i = 0; i < 17; i++) if (stricmp(music_name, musicexception_list[i]) == 0 || stricmp(newmus, musicexception_list[i]) == 0) // weird? sure! but were lucky enough newmus reflects whats being replaced { skipmusic = true; @@ -2242,15 +2242,7 @@ void S_CheckMap(void) // void S_InitMapMusic(void) { - if (!cv_skipintromusic.value) - skipintromus = false; - else - { - char *maptitle = G_BuildMapTitle(gamemap); - skipintromus = cv_skipintromusic.value && stricmp(maptitle, "Wandering Falls") != 0; // thanks diggle! - if (maptitle) - Z_Free(maptitle); - } + skipintromus = false; if (mapmusflags & MUSIC_RELOADRESET) { @@ -2268,6 +2260,15 @@ void S_InitMapMusic(void) // lug: but not when we keep the map music lol S_StopMusic(); + if (cv_skipintromusic.value) + { + char *maptitle = G_BuildMapTitle(gamemap); + // for some reason, occasionally the title screen music doesent seem to be reset in time, so skipping the intro may make it just continue playing it instead, weird.. + skipintromus = (stricmp(music_name, "titles") != 0) && (stricmp(maptitle, "Wandering Falls") != 0); // thanks diggle! + if (maptitle) + Z_Free(maptitle); + } + if (skipintromus) return;