Play a goofy sound when I_Erroring

Reorders shutdown in I_Error a little bit so the message
box displays before I_ShutdownSound and SDL_Quit (so the
sound can continue playing while the message box is open).
This should not have any other effects and
I_ShutdownGraphics is still done beforehand, which closes
the main game window.
This commit is contained in:
James R 2023-03-29 23:29:04 -07:00
parent c6f891f545
commit da004414a3

View file

@ -1633,6 +1633,12 @@ void I_Error(const char *error, ...)
exit(-1); // recursive errors detected
}
}
else
{
// This makes crashes funnier by stimulating the funnicampus of the brain
S_StopSounds();
S_StartSound(NULL, sfx_etexpl);
}
shutdowning = true;
@ -1661,13 +1667,10 @@ void I_Error(const char *error, ...)
D_QuitNetGame();
CL_AbortDownloadResume();
M_FreePlayerSetupColors();
I_ShutdownMusic();
I_ShutdownSound();
// use this for 1.28 19990220 by Kin
I_ShutdownGraphics();
I_ShutdownInput();
I_ShutdownSystem();
SDL_Quit();
// Implement message box with SDL_ShowSimpleMessageBox,
// which should fail gracefully if it can't put a message box up
@ -1677,6 +1680,12 @@ void I_Error(const char *error, ...)
"Dr. Robotnik's Ring Racers "VERSIONSTRING" Error",
buffer, NULL);
// We wait until now to do this so the funny sound can be heard
I_ShutdownSound();
// use this for 1.28 19990220 by Kin
I_ShutdownSystem();
SDL_Quit();
// Note that SDL_ShowSimpleMessageBox does *not* require SDL to be
// initialized at the time, so calling it after SDL_Quit() is
// perfectly okay! In addition, we do this on purpose so the