From 01ba834086583208a6820e451d4b5c474c09a92a Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 13 Apr 2021 14:38:45 -0700 Subject: [PATCH] Don't tick timer if in time trial countdown In 2.2 and previous, the game would call resetgameclock() every frame for the last 30 frames of the time trial countdown in order to make sure it gets reset. This was in a render function, and didn't get brought out in 2.3, so 2.3 resets the game clock *while rendering*, which is kinda bad and is an oversight on my part for not noticing. Instead of doing that, just add a conditional to the timer so that it won't tick during the time trial countdown. This fixes #699 even further by making it so the time trial par can't even be lost during the countdown, because the timer won't tick up - so you can never get a sad squeak to play by pausing the game or unfocus-pausing it during the countdown. --- desktop_version/src/Game.cpp | 5 +++++ desktop_version/src/Render.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index d045f3c6..16013323 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -5683,6 +5683,11 @@ std::string Game::unrescued(void) void Game::gameclock(void) { + if (timetrialcountdown > 0) + { + return; + } + frames++; if (frames >= 30) { diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index e1913901..dc8f7b0b 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1769,7 +1769,6 @@ void gamerender(void) { if (game.timetrialcountdown < 30) { - game.resetgameclock(); if (int(game.timetrialcountdown / 4) % 2 == 0) graphics.bigprint( -1, 100, "Go!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 4); } else if (game.timetrialcountdown < 60)