From c165b0761c987daaa68550cfcebb387cf55e1239 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 27 Aug 2020 18:50:36 -0400 Subject: [PATCH] Misc changes to how the program runs - Call DRPC_Init at the end of D_SRB2Main instead of in the middle - Call Discord_RunCallbacks in D_SRB2Loop instead of G_Ticker - Fix errorcount nums in I_Error, an old leftover from when Discord_Shutdown was not handled by I_AddExitFunction --- src/d_main.c | 12 ++++++++---- src/g_game.c | 4 ---- src/sdl/i_system.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 9d5d29a2..4b7db807 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -731,6 +731,10 @@ void D_SRB2Loop(void) #ifdef HAVE_BLUA LUA_Step(); #endif + +#ifdef HAVE_DISCORDRPC + Discord_RunCallbacks(); +#endif } } @@ -1427,10 +1431,6 @@ void D_SRB2Main(void) CONS_Printf("ST_Init(): Init status bar.\n"); ST_Init(); -#ifdef HAVE_DISCORDRPC - DRPC_Init(); -#endif - if (M_CheckParm("-room")) { if (!M_IsNextParm()) @@ -1617,6 +1617,10 @@ void D_SRB2Main(void) if (!P_SetupLevel(false)) I_Quit(); // fail so reset game stuff } + +#ifdef HAVE_DISCORDRPC + DRPC_Init(); +#endif } const char *D_Home(void) diff --git a/src/g_game.c b/src/g_game.c index 495131e8..dcc1adff 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2503,10 +2503,6 @@ void G_Ticker(boolean run) if (spectatedelay4) spectatedelay4--; } - -#ifdef HAVE_DISCORDRPC - Discord_RunCallbacks(); -#endif } // diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 419204cd..3a1dd124 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3251,11 +3251,11 @@ void I_Error(const char *error, ...) I_ShutdownGraphics(); if (errorcount == 6) I_ShutdownInput(); - if (errorcount == 8) + if (errorcount == 7) I_ShutdownSystem(); - if (errorcount == 9) + if (errorcount == 8) SDL_Quit(); - if (errorcount == 10) + if (errorcount == 9) { M_SaveConfig(NULL); G_SaveGameData(false);