From da004414a34054313d51a5b5aa8e06519c639055 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 29 Mar 2023 23:29:04 -0700 Subject: [PATCH] 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. --- src/sdl/i_system.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index d155a5f93..b0598a05b 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -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