From 5a3ed5464e29295023d46c4019b82cf65465824d Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 3 Jun 2023 14:18:01 +0100 Subject: [PATCH] P_Ticker: Do not start position music or play noises if gametype has no time between intro and start --- src/p_tick.c | 66 ++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/src/p_tick.c b/src/p_tick.c index da4cc46da..871420055 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -873,43 +873,47 @@ void P_Ticker(boolean run) } else if (leveltime < starttime + TICRATE) { - // Start countdown/music handling - if (leveltime == starttime-(3*TICRATE)) - { - S_StartSound(NULL, sfx_s3ka7); // 3, - S_FadeMusic(0, 3500); //S_FadeOutStopMusic(3500); -- TODO the S_StopMusic callback can halt successor music instead - } - else if ((leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) - { - S_StartSound(NULL, sfx_s3ka7); // 2, 1, - } - else if (leveltime == starttime) - { - S_StartSound(NULL, sfx_s3kad); // GO! - } - else if (leveltime == (starttime + (TICRATE/2))) + if (leveltime == (starttime + (TICRATE/2))) { // Plays the music after the starting countdown. S_ChangeMusic(mapmusname, mapmusflags, true); S_ShowMusicCredit(); } + else if (starttime != introtime) + { + // Start countdown/music handling + if (leveltime == starttime-(3*TICRATE)) + { + S_StartSound(NULL, sfx_s3ka7); // 3, + S_FadeMusic(0, 3500); //S_FadeOutStopMusic(3500); -- TODO the S_StopMusic callback can halt successor music instead + } + else if ((leveltime == starttime-(2*TICRATE)) + || (leveltime == starttime-TICRATE)) + { + S_StartSound(NULL, sfx_s3ka7); // 2, 1, + } + else if (leveltime == starttime) + { + S_StartSound(NULL, sfx_s3kad); // GO! + } - // POSITION!! music - if (encoremode) - { - // Encore humming starts immediately. - if (leveltime == 1) - S_ChangeMusicInternal("encore", true); - } - else - { - // Plays the POSITION music after the camera spin - if (leveltime == introtime) - S_ChangeMusicInternal( - (mapheaderinfo[gamemap-1]->positionmus[0] - ? mapheaderinfo[gamemap-1]->positionmus - : "postn" - ), true); + // POSITION!! music + if (encoremode) + { + // Encore humming starts immediately. + if (leveltime == 1) + S_ChangeMusicInternal("encore", true); + } + else + { + // Plays the POSITION music after the camera spin + if (leveltime == introtime) + S_ChangeMusicInternal( + (mapheaderinfo[gamemap-1]->positionmus[0] + ? mapheaderinfo[gamemap-1]->positionmus + : "postn" + ), true); + } } }