Move starting countdown sounds to p_tick.c

Fixes an issue where the starting countdown wouldn't play in spectator mode or hitlag
This commit is contained in:
toaster 2023-03-01 16:32:23 +00:00
parent 5ee9b9d5b6
commit 13a987a0a2
2 changed files with 13 additions and 12 deletions

View file

@ -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)

View file

@ -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);