Skip to content

Commit

Permalink
Display best grade of all for songs without current style steps in au…
Browse files Browse the repository at this point in the history
…tosetstyle
  • Loading branch information
nico-abram committed Jan 7, 2018
1 parent eca9e2f commit aba80ed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/MusicWheelItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,32 @@ void MusicWheelItem::RefreshGrades()
Difficulty dcBest = Difficulty_Invalid;
if (PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid) {
if (pWID->m_pSong) {
bool hasCurrentStyleSteps = false;
FOREACH_ENUM_N(Difficulty, 6, i) {
Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, i);
if (pSteps != NULL) {
hasCurrentStyleSteps = true;
Grade dcg = SCOREMAN->GetBestGradeFor(pSteps->GetChartKey());
if (gradeBest >= dcg) {
dcBest = i;
gradeBest = dcg;
}
}
}
//If no grade was found for the current style/stepstype
if (!hasCurrentStyleSteps) {
//Get the best grade among all steps
auto& allSteps = pWID->m_pSong->GetAllSteps();
for (auto& stepsPtr : allSteps) {
if (stepsPtr->m_StepsType == st) //Skip already checked steps of type st
continue;
Grade dcg = SCOREMAN->GetBestGradeFor(stepsPtr->GetChartKey());
if (gradeBest >= dcg) {
dcBest = stepsPtr->GetDifficulty();
gradeBest = dcg;
}
}
}
}
}

Expand Down

0 comments on commit aba80ed

Please sign in to comment.