mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
Use COM_ImmedExecute("restartaudio") instead of duplicated code
This commit is contained in:
parent
a1da768a87
commit
40b9644e0c
2 changed files with 6 additions and 17 deletions
|
@ -4855,9 +4855,13 @@ static void Command_RestartAudio_f(void)
|
|||
I_SetSfxVolume(cv_soundvolume.value);
|
||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
||||
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
|
||||
if (Playing()) // Gotta make sure the player is in a level
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
|
||||
else
|
||||
S_ChangeMusicInternal("titles", looptitle);
|
||||
}
|
||||
|
||||
/** Quits a game and returns to the title screen.
|
||||
|
|
17
src/m_menu.c
17
src/m_menu.c
|
@ -9043,22 +9043,7 @@ static void M_ToggleDigital(INT32 choice)
|
|||
|
||||
static void M_RestartAudio(void)
|
||||
{
|
||||
S_StopMusic();
|
||||
I_ShutdownMusic();
|
||||
I_ShutdownSound();
|
||||
I_StartupSound();
|
||||
I_InitMusic();
|
||||
|
||||
I_SetSfxVolume(cv_soundvolume.value);
|
||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
||||
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
|
||||
if (Playing()) // Gotta make sure the player is in a level
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("titles", looptitle);
|
||||
COM_ImmedExecute("restartaudio");
|
||||
}
|
||||
|
||||
// ===============
|
||||
|
|
Loading…
Reference in a new issue