From 25179000101bf0a4467b16240eaf0cd69745d3fc Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 13 Apr 2021 14:36:21 -0700 Subject: [PATCH] De-duplicate zeroing the game clock For some reason, resetgameclock() is only ever used in gamerender(), and everywhere else just zeroes the clock manually. This is weird to me, so I've made it so everywhere that zeroes the clock uses the resetgameclock() function to do so. --- desktop_version/src/Game.cpp | 5 +---- desktop_version/src/Script.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 2a01900e..d045f3c6 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -214,10 +214,7 @@ void Game::init(void) deathcounts = 0; gameoverdelay = 0; - frames = 0; - seconds = 0; - minutes = 0; - hours = 0; + resetgameclock(); gamesaved = false; gamesavefailed = false; savetime = "00:00"; diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index ac3c4be3..1397c7c9 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1542,10 +1542,7 @@ void scriptclass::run(void) game.deathcounts = 0; game.advancetext = false; game.hascontrol = true; - game.frames = 0; - game.seconds = 0; - game.minutes = 0; - game.hours = 0; + game.resetgameclock(); game.gravitycontrol = 0; game.teleport = false; game.companion = 0; @@ -3543,10 +3540,7 @@ void scriptclass::hardreset(void) game.deathcounts = 0; game.gameoverdelay = 0; - game.frames = 0; - game.seconds = 0; - game.minutes = 0; - game.hours = 0; + game.resetgameclock(); game.gamesaved = false; game.gamesavefailed = false; game.savetime = "00:00";