Use COM_ImmedExecute("restartaudio") instead of duplicated code

This commit is contained in:
TehRealSalt 2018-10-22 16:32:06 -04:00
parent a1da768a87
commit 40b9644e0c
2 changed files with 6 additions and 17 deletions

View file

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

View file

@ -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");
}
// ===============