From 527492610a64f971b29c348043bda3eb72bd12e8 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 7 Jan 2024 22:02:09 +0000 Subject: [PATCH] Fix `inttime 0` Important testing apparatus while working on the previous commit --- src/g_game.c | 25 +++++++++++++------------ src/y_inter.c | 29 +++++++++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 755f62234..933634b01 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4374,26 +4374,27 @@ static void G_DoCompleted(void) // If the current gametype has no intermission screen set, then don't start it. Y_DetermineIntermissionType(); - if (intertype == int_none) + if (intertype != int_none) { - G_UpdateVisited(); - if (grandprixinfo.gp == true) - { - K_UpdateGPRank(&grandprixinfo.rank); - } - G_AfterIntermission(); - } - else - { - G_SetGamestate(GS_INTERMISSION); Y_StartIntermission(); - G_UpdateVisited(); } + else if (grandprixinfo.gp == true) + { + K_UpdateGPRank(&grandprixinfo.rank); + } + + G_UpdateVisited(); // This isn't in the above blocks because many // mechanisms can queue up a gamedata save. if (gamedata->deferredsave) G_SaveGameData(); + + // Seperate from the above, as Y_StartIntermission can no-sell. + if (intertype == int_none) + { + G_AfterIntermission(); + } } // See also F_EndCutscene, the only other place which handles intra-map/ending transitions diff --git a/src/y_inter.c b/src/y_inter.c index 5a384c16f..84ffa9398 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1982,10 +1982,7 @@ void Y_StartIntermission(void) // determine the tic everybody's scores/PWR starts getting sorted sorttic = -1; if (!timer) - { - // Prevent a weird bug - timer = 1; - } + ; else if ( ( // Match Race or Time Attack netgame == false @@ -2033,11 +2030,6 @@ void Y_StartIntermission(void) if (prevmap >= nummapheaders || !mapheaderinfo[prevmap]) I_Error("Y_StartIntermission: Internal map ID %d not found (nummapheaders = %d)", prevmap, nummapheaders); - if (timer > 1 && musiccountdown == 0) - Music_Play("intermission"); - - S_ShowMusicCredit(); // Always call - switch (intertype) { case int_score: @@ -2058,9 +2050,6 @@ void Y_StartIntermission(void) break; } - LUA_HUD_DestroyDrawList(luahuddrawlist_intermission); - luahuddrawlist_intermission = LUA_HUD_CreateDrawList(); - if (powertype != PWRLV_DISABLED) { for (i = 0; i < MAXPLAYERS; i++) @@ -2078,6 +2067,22 @@ void Y_StartIntermission(void) SV_BumpMatchStats(); } + if (!timer) + { + Y_EndIntermission(); + return; + } + + G_SetGamestate(GS_INTERMISSION); + + if (musiccountdown == 0) + Music_Play("intermission"); + + S_ShowMusicCredit(); // Always call + + LUA_HUD_DestroyDrawList(luahuddrawlist_intermission); + luahuddrawlist_intermission = LUA_HUD_CreateDrawList(); + if (roundqueue.size > 0 && roundqueue.position == roundqueue.size) { Automate_Run(AEV_QUEUEEND);