From 13a987a0a22f2bbbeba22769a1d9a05114f7706b Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 1 Mar 2023 16:32:23 +0000 Subject: [PATCH] Move starting countdown sounds to p_tick.c Fixes an issue where the starting countdown wouldn't play in spectator mode or hitlag --- src/k_kart.c | 12 ------------ src/p_tick.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 5d4c7eb5d..24e0b9d7b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -11036,18 +11036,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { player->pflags &= ~PF_AIRFAILSAFE; } - - // Play the starting countdown sounds - if (player == &players[g_localplayers[0]]) // Don't play louder in splitscreen - { - if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) - S_StartSound(NULL, sfx_s3ka7); - - if (leveltime == starttime-(3*TICRATE)) - S_FadeOutStopMusic(3500); - else if (leveltime == starttime) - S_StartSound(NULL, sfx_s3kad); - } } void K_CheckSpectateStatus(void) diff --git a/src/p_tick.c b/src/p_tick.c index 91be6d183..28de3a6c2 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -659,6 +659,19 @@ void P_Ticker(boolean run) // Plays the music after the starting countdown. else { + if (leveltime == starttime-(3*TICRATE)) + { + S_StartSound(NULL, sfx_s3ka7); // 3, + S_FadeOutStopMusic(3500); + } + 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! + } if (leveltime == (starttime + (TICRATE/2))) { S_ChangeMusic(mapmusname, mapmusflags, true);