From 78bb58a830449352253d87fe49b187eb2c74da2b Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Sat, 14 Sep 2024 07:33:53 -0300 Subject: [PATCH] FIX: Double total stat calculation --- src/scenes/StatsScene.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/scenes/StatsScene.cpp b/src/scenes/StatsScene.cpp index 4357618e..dfa8f634 100644 --- a/src/scenes/StatsScene.cpp +++ b/src/scenes/StatsScene.cpp @@ -263,18 +263,24 @@ StatsScene::ArcadePercentages StatsScene::getArcadeProgress() { for (u32 i = 0; i < songFiles.size(); i++) { Song* song = SONG_parse(fs, songFiles[i].get()); + u32 songTotalSingle = 0; + u32 songTotalDouble = 0; + for (u32 j = 0; j < song->chartCount; j++) { if (song->charts[j].type == ChartType::SINGLE_CHART) { - if (ARCADE_readSingle(song->id, totalSingle) < GradeType::UNPLAYED) + if (ARCADE_readSingle(song->id, songTotalSingle) < GradeType::UNPLAYED) completedSingle++; - totalSingle++; + songTotalSingle++; } else { - if (ARCADE_readDouble(song->id, totalDouble) < GradeType::UNPLAYED) + if (ARCADE_readDouble(song->id, songTotalDouble) < GradeType::UNPLAYED) completedDouble++; - totalDouble++; + songTotalDouble++; } } + totalSingle += songTotalSingle; + totalDouble += songTotalDouble; + SONG_free(song); }