From d0d61cbc1523986409eef734fd95d9ee018ab22a Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 8 May 2024 16:49:17 +0530 Subject: Fixed bug where changing layout on game over would overflow timer --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index d22360b..e3d69fb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -420,16 +420,22 @@ int main(void) { state.layout = State::Layout::UNLIMITED; state.reset(); + time_start = Clock::now(); + time_cur = time_start; } else if (IsKeyPressed(KEY_TWO)) { state.layout = State::Layout::WALLS; state.reset(); + time_start = Clock::now(); + time_cur = time_start; } else if (IsKeyPressed(KEY_THREE)) { state.layout = State::Layout::WALLED_GARDEN; state.reset(); + time_start = Clock::now(); + time_cur = time_start; } if (!paused && !failed) { -- cgit v1.2.3-13-gbd6f