From d06b8ac398d7fad39f9175ece8b79ca54e1925d6 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 30 Sep 2024 16:32:03 +0200 Subject: [PATCH] cleanup + comments --- src/p_spec.c | 2 +- src/s_sound.c | 23 +++++++---------------- src/s_sound.h | 2 -- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f09562f4d..e7d937a91 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2135,7 +2135,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (keepmusic && (leveltime < (starttime + TICRATE))) //why check for starttime? cause encore music Zzz... return; - if (ignoremusicchanges && (leveltime > (starttime + TICRATE) && !fromlapexec)) // keep lap music intanct tho + if (cv_ignoremusicchanges.value && (leveltime > (starttime + TICRATE) && !fromlapexec)) // keep lap music intanct tho return; // console player only unless NOCLIMB is set diff --git a/src/s_sound.c b/src/s_sound.c index 2970bce63..4ac8a9860 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -123,7 +123,6 @@ consvar_t cv_keepmusic = {"keepmusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, N consvar_t cv_skipintromusic = {"skipintromusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ignoremusicchanges = {"ignoremusicchanges", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; -boolean ignoremusicchanges = false; boolean keepmusic = false; static void S_CheckEventMus(const char *newmus); @@ -2204,9 +2203,6 @@ static const char *musicexception_list[16] = { //always runs when musicchange gets invoked static void S_CheckEventMus(const char *newmus) { - //if (leveltime > (starttime + (TICRATE/2))) - //return; - skipmusic = false; if (!cv_keepmusic.value) @@ -2214,8 +2210,7 @@ static void S_CheckEventMus(const char *newmus) return; } - //this one compares map and encoremode instead of the music itself - //makes tunes work and stuff + for (int i = 0; i < 16; i++) if (strcmp(music_name, musicexception_list[i]) == 0 || strcmp(newmus, musicexception_list[i]) == 0) { @@ -2228,7 +2223,8 @@ static void S_CheckEventMus(const char *newmus) //CONS_Printf("newmus = %d\n", skipmusic); } -//check if map and encoremode has changed +//this one compares map and encoremode instead of the music itself +//makes tunes work and stuff void S_CheckMap(void) { if (!cv_keepmusic.value) @@ -2276,9 +2272,6 @@ void S_InitMapMusic(void) void S_StartMapMusic(void) { - // need to be after race starts so "certain" maps don“t break Zzz... - ignoremusicchanges = cv_ignoremusicchanges.value && (leveltime > (starttime + (TICRATE/2))); - //no need to constantly run this after race has started //but let it run atleast half a tic after map music started to let shit update lmao if (leveltime > (starttime + TICRATE)) @@ -2289,20 +2282,18 @@ void S_StartMapMusic(void) if (cv_skipintromusic.value) { - if (leveltime == 0) + if (leveltime == 0) // dumb but i dont need this to be spammed honestly S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); if (leveltime == (starttime + (TICRATE/2))) S_ShowMusicCredit(); return; } - // The GO! sound stops the level start ambience - if (leveltime == starttime) + if (leveltime == starttime) // The GO! sound stops the level start ambience S_StopMusic(); else if (leveltime < starttime) // SRB2Kart - S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); - // Plays the music after the starting countdown. - else if (leveltime == (starttime + (TICRATE/2))) + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); // yes this will be spammed otherwise encore and some stuff WILL overwrite it + else if (leveltime == (starttime + (TICRATE/2))) // Plays the music after the starting countdown. { S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); S_ShowMusicCredit(); diff --git a/src/s_sound.h b/src/s_sound.h index 0c576bfc1..9d53cc357 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -70,8 +70,6 @@ extern consvar_t cv_birdmusic; extern consvar_t cv_keepmusic; extern consvar_t cv_skipintromusic; extern consvar_t cv_ignoremusicchanges; - -extern boolean ignoremusicchanges; extern boolean keepmusic; extern consvar_t precachesound;