From fa075010c8457b60fb8dd683807cd549dba2273f Mon Sep 17 00:00:00 2001 From: Info Teddy Date: Mon, 13 Jan 2020 17:54:44 -0800 Subject: [PATCH] Fix being able to set lower custom level score For reference, here is the list of scores for a custom level: 0 - not played 1 - finished 2 - all trinkets 3 - finished, all trinkets Previously, you could've played a level and finished it and set a score of 3. Then you could re-play the entire level, but manage to only get a score of 1, i.e. only finished but not with all trinkets. Then your score for that level would get set back to 1, which basically nullifies the time you spent playing that level and getting all of the trinkets. This commit makes it so your new score will get set only if it is higher than the previous one. --- desktop_version/src/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index a61f552d..e3cd9085 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -449,7 +449,7 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore) j=numcustomlevelstats+1; } } - if(tvar>=0) + if(tvar>=0 && cscore > customlevelscore[tvar]) { //update existing entry customlevelscore[tvar]=cscore;