From f70351fc75b49f518809ab9d61aa4b79fe5a72a5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 2 Mar 2025 21:42:14 +0100 Subject: [PATCH] screw you music system no fucking clue but this fixes stuff showing the musiccredit too early on reload --- src/s_sound.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 2af2ee668..8b1b9dfc0 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1997,20 +1997,6 @@ static void S_SetKeepMusicStuff(void) keepmusic.position = mapmusic.position; } -// replace mapmusic with our saved keepmusic stuff -static void S_CopyKeepMusicStuff(void) -{ - if (!cv_keepmusic.value) - { - return; - } - - - strncpy(mapmusic.name, keepmusic.name, 7); - mapmusic.flags = keepmusic.flags; - mapmusic.position = keepmusic.position; -} - // determine if we should keep the music on a map restart // this gets called BEFORE the level gets loaded in G_DoLoadLevel void S_KeepMusic(void) @@ -2046,19 +2032,20 @@ void S_HandleReloadResetMusic(void) if (!(mapmusic.flags & MUSIC_RELOADRESET)) return; + // replace mapmusic with our saved keepmusic stuff if (keepmapmusic) { // this is horrible, but oh well - S_CopyKeepMusicStuff(); + strncpy(mapmusic.name, keepmusic.name, 7); } else { strncpy(mapmusic.name, mapheaderinfo[gamemap-1]->musname, 7); - mapmusic.name[6] = 0; - mapmusic.flags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); - mapmusic.position = mapheaderinfo[gamemap-1]->muspos; } + mapmusic.name[6] = 0; + mapmusic.flags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); + mapmusic.position = mapheaderinfo[gamemap-1]->muspos; mapmusic.resume = 0; } @@ -2093,7 +2080,9 @@ void S_InitMapMusic(void) { // this is kinda silly, but we can use it to fade back into the map song at the saved point, should the current music be different from the map music if (resumekeepmusic) + { S_ChangeMusicEx(mapmusic.name, mapmusic.flags, true, keepmusic.resume, 0, 500); + } return; } @@ -2117,7 +2106,9 @@ void S_StartMapMusic(void) return; if (keepmapmusic) + { return; + } if (skipintromus) {