Skip to content

Commit 337277f

Browse files
committed
support fails and negative best wifes for wife grade sorting
in my opinion this should stay a strict grade sort but im all for writing hacks
1 parent 8119385 commit 337277f

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/Etterna/Models/Songs/SongUtil.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,30 @@ get_best_wife_score_for_song_and_profile(const Song* song, const Profile* p)
487487
-> float
488488
{
489489
assert(p != nullptr);
490-
return p->GetBestWifeScore(
491-
song,
492-
GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())
493-
->m_StepsType);
490+
auto st = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())
491+
->m_StepsType;
492+
auto score = p->GetBestWifeScore(song, st);
493+
494+
// if the only score is a fail we want them all sorted into the same group
495+
// and all fails best wife scores should be 0% (technically)
496+
// so ... set them to .001
497+
// because that is different from 0, for files that have no score
498+
if (score <= 0.F) {
499+
// alas, it is possible to get a D if you have nofail on...
500+
auto g = p->GetBestGrade(song, st);
501+
if (g == Grade_Failed)
502+
// the F tier will be filled with random looking F scores
503+
return 0.001F;
504+
else if (g == Grade_Tier16)
505+
// this fills up the D tier with weird looking scores
506+
// their order changes seemingly randomly
507+
// to be tbh honest thats not important
508+
return 0.002F;
509+
else
510+
// ????
511+
return 0.F;
512+
}
513+
return score;
494514
}
495515

496516
static int

0 commit comments

Comments
 (0)