Skip to content

Commit

Permalink
support fails and negative best wifes for wife grade sorting
Browse files Browse the repository at this point in the history
in my opinion this should stay a strict grade sort but im all for writing hacks
  • Loading branch information
poco0317 committed Jul 13, 2020
1 parent 8119385 commit 337277f
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/Etterna/Models/Songs/SongUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,30 @@ get_best_wife_score_for_song_and_profile(const Song* song, const Profile* p)
-> float
{
assert(p != nullptr);
return p->GetBestWifeScore(
song,
GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())
->m_StepsType);
auto st = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())
->m_StepsType;
auto score = p->GetBestWifeScore(song, st);

// if the only score is a fail we want them all sorted into the same group
// and all fails best wife scores should be 0% (technically)
// so ... set them to .001
// because that is different from 0, for files that have no score
if (score <= 0.F) {
// alas, it is possible to get a D if you have nofail on...
auto g = p->GetBestGrade(song, st);
if (g == Grade_Failed)
// the F tier will be filled with random looking F scores
return 0.001F;
else if (g == Grade_Tier16)
// this fills up the D tier with weird looking scores
// their order changes seemingly randomly
// to be tbh honest thats not important
return 0.002F;
else
// ????
return 0.F;
}
return score;
}

static int
Expand Down

0 comments on commit 337277f

Please sign in to comment.