From 7df42242e7b3b7ca3b148c4f4c02b853f4ba8b62 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 26 Apr 2020 13:38:24 -0700 Subject: [PATCH] Actually delete saves/unlock.vvv in deletestats() Having to blank everything out in the stats file is very kludge-y. --- desktop_version/src/Game.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 06f743bd..1f0fd817 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -4215,21 +4215,27 @@ void Game::gethardestroom() void Game::deletestats() { - for (int i = 0; i < 25; i++) + if (!FILESYSTEM_delete("saves/unlock.vvv")) { - unlock[i] = false; - unlocknotify[i] = false; + puts("Error deleting saves/unlock.vvv"); } - for (int i = 0; i < 6; i++) + else { - besttimes[i] = -1; - besttrinkets[i] = -1; - bestlives[i] = -1; - bestrank[i] = -1; + for (int i = 0; i < 25; i++) + { + unlock[i] = false; + unlocknotify[i] = false; + } + for (int i = 0; i < 6; i++) + { + besttimes[i] = -1; + besttrinkets[i] = -1; + bestlives[i] = -1; + bestrank[i] = -1; + } + graphics.setflipmode = false; + stat_trinkets = 0; } - graphics.setflipmode = false; - stat_trinkets = 0; - savestats(); } void Game::unlocknum( int t )