From 5103b804bac2b7166862c3c12329e5a21f101b0e Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 13 Oct 2022 13:12:07 +0100 Subject: [PATCH] Simplify intermission timer code - We had two ways of ending the intermission, but only one would actually be used, and it resulted in code duplication. - Combine the two ways. - Disable the reached-but-didn't-do-anything-before-now code path for setting endtic. --- src/y_inter.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 68ee56c89..c0fbd8588 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -657,18 +657,8 @@ void Y_Ticker(void) P_DoTeamscrambling(); }*/ - // multiplayer uses timer (based on cv_inttime) - if (timer) - { - if (!--timer) - { - Y_EndIntermission(); - G_AfterIntermission(); - return; - } - } - // single player is hardcoded to go away after awhile - else if (intertic == endtic) + if ((timer && !--timer) + || (intertic == endtic)) { Y_EndIntermission(); G_AfterIntermission(); @@ -746,8 +736,8 @@ void Y_Ticker(void) S_StartSound(NULL, (kaching ? sfx_chchng : sfx_ptally)); Y_CalculateMatchData(2, Y_CompareRank); } - else - endtic = intertic + 3*TICRATE; // 3 second pause after end of tally + /*else -- This is how to define an endtic, but we currently use timer for both SP and MP. + endtic = intertic + 3*TICRATE;*/ } } }