diff --git a/src/p_spec.c b/src/p_spec.c index d94e2a797..b66b69bc1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2127,6 +2127,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) break; case 413: // Change music + //if (ignoremusicchanges) + //return; + // console player only unless NOCLIMB is set if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player))) { @@ -2209,6 +2212,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { INT32 sfxnum; + //dont play any funky sound intros that may interfere with the music + //if (cv_skipintromusic.value && (leveltime < (starttime + (TICRATE/2)))) + //return; + sfxnum = sides[line->sidenum[0]].toptexture; //P_AproxDistance(line->dx, line->dy)>>FRACBITS; if (sfxnum == sfx_None) diff --git a/src/p_user.c b/src/p_user.c index 46f027652..2bd9cfb73 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -611,6 +611,9 @@ boolean P_EndingMusic(player_t *player) INT32 bestlocalpos; player_t *bestlocalplayer; + //if (!ignoremusicchanges) + //return false; + if (!P_IsLocalPlayer(player)) // Only applies to a local player return false; diff --git a/src/s_sound.c b/src/s_sound.c index ffe9f9e9e..6a733e50a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1946,6 +1946,28 @@ boolean S_FadeOutStopMusic(UINT32 ms) return I_FadeSong(0, ms, &S_StopMusic); } + +static boolean S_KeepMusic(const char *mapmusicname) +{ + //if (!cv_keepmusic.value) + //return false; + + // should i compare songs or maps? + // comparing songs makes this alot easier honestly + static char oldmusname[7] = ""; + + if (strcmp(music_name, mapmusicname) != 0) + return false; + + if (strcmp(oldmusname, mapmusicname) == 0) + return true; + + strncpy(oldmusname, mapmusicname, 7); + oldmusname[6] = '\0'; + + return false; +} + /// ------------------------ /// Init & Others /// ------------------------ @@ -1966,6 +1988,16 @@ void S_Start(void) mapmusresume = 0; } + if (S_KeepMusic(mapmusname)) + return; + + /*if (cv_skipintromusic.value) + { + S_StopMusic(); + S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); + return; + }*/ + S_StopMusic(); if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart @@ -1975,7 +2007,21 @@ void S_Start(void) void M_Start(void) { - if (leveltime > (starttime + (TICRATE/2))) + // 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)) + return; + + /*if (cv_skipintromusic.value && leveltime == (starttime + (TICRATE/2))) + { + S_ShowMusicCredit(); + return; + }*/ + + if (S_KeepMusic(mapmusname)) return; // The GO! sound stops the level start ambience @@ -1990,6 +2036,7 @@ void M_Start(void) } } + void S_RestartMusic(void) { S_StopMusic();