Skip to content

Commit

Permalink
FIX: Double total stat calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
afska committed Sep 14, 2024
1 parent 0fea2e1 commit 78bb58a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/scenes/StatsScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 78bb58a

Please sign in to comment.