Skip to content

Commit

Permalink
assert maxpoints > 0 in fillinhighscore
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 20, 2020
1 parent eed784f commit 61b94c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Etterna/Models/Misc/StageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,16 @@ FillInHighScore(const PlayerStageStats& pss,
auto steps = GAMESTATE->m_pCurSteps;
auto nd = steps->GetNoteData();
auto* td = steps->GetTimingData();
auto maxpoints = static_cast<float>(nd.WifeTotalScoreCalc(td));

// i _think_ an assert is ok here.. if this can happen we probably want
// to know about it
ASSERT(maxpoints > 0);

if (pss.GetGrade() == Grade_Failed)
hs.SetSSRNormPercent(0.f);
else
hs.RescoreToWife3(static_cast<float>(nd.WifeTotalScoreCalc(td)));
hs.RescoreToWife3(maxpoints);

if (hs.GetEtternaValid()) {
vector<float> dakine = pss.CalcSSR(hs.GetSSRNormPercent());
Expand Down

0 comments on commit 61b94c7

Please sign in to comment.