mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Use COM_ImmedExecute("restartaudio") instead of duplicated code
This commit is contained in:
parent
a45f86c1fd
commit
5a4045095d
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_SetSfxVolume(cv_soundvolume.value);
|
||||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||||
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
||||||
|
|
||||||
|
S_StartSound(NULL, sfx_strpst);
|
||||||
|
|
||||||
if (Playing()) // Gotta make sure the player is in a level
|
if (Playing()) // Gotta make sure the player is in a level
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
|
else
|
||||||
|
S_ChangeMusicInternal("titles", looptitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Quits a game and returns to the title screen.
|
/** 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)
|
static void M_RestartAudio(void)
|
||||||
{
|
{
|
||||||
S_StopMusic();
|
COM_ImmedExecute("restartaudio");
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===============
|
// ===============
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue