From 0c5815c176c95e8fe8b5ca278f67da3fcd65801a Mon Sep 17 00:00:00 2001 From: lemz Date: Sat, 13 Jul 2024 21:27:14 +0200 Subject: [PATCH] add completion check --- source/funkin/save/Save.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 2900ce2be..5e3d1b745 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -545,11 +545,14 @@ class Save return; } + var newCompletion = (newScoreData.tallies.sick + newScoreData.tallies.good) / newScoreData.tallies.totalNotes; + var previousCompletion = (previousScoreData.tallies.sick + previousScoreData.tallies.good) / previousScoreData.tallies.totalNotes; + // Set the high score and the high rank separately. var newScore:SaveScoreData = { score: (previousScoreData.score > newScoreData.score) ? previousScoreData.score : newScoreData.score, - tallies: (previousRank > newRank) ? previousScoreData.tallies : newScoreData.tallies + tallies: (previousRank > newRank || previousCompletion > newCompletion) ? previousScoreData.tallies : newScoreData.tallies }; song.set(difficultyId, newScore);