From 8edfc3824cf40031f130a9a1fe649ad75bc9c805 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Tue, 6 Dec 2016 19:34:02 -0500 Subject: [PATCH] fix ssr recalc function --- src/Profile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Profile.cpp b/src/Profile.cpp index e7d906fe6a..ab38a00b20 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -2056,10 +2056,15 @@ void Profile::ResetAllSSRs() { m_fPlayerRating = 0.f; } + // should prolly generalize some of the stuff here - mina void Profile::RecalculateAllSSRs() { FOREACHM(SongID, HighScoresForASong, m_SongHighScores, i) { const SongID& id = i->first; + + if (!id.IsValid()) + continue; + HighScoresForASong& hsfas = i->second; FOREACHM(StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j) { HighScoresForASteps& zz = j->second; @@ -2070,8 +2075,12 @@ void Profile::RecalculateAllSSRs() { hsv[i].SetSSR(0.f); else { Song* psong = id.ToSong(); - Steps* psteps= j->first.ToSteps(psong, false); + const StepsID& sid = j->first; + + if (!sid.IsValid()) + continue; + Steps* psteps= sid.ToSteps(psong, false); NoteData& nd = psteps->GetNoteData(); TimingData* td = psteps->GetTimingData(); float musicrate = hsv[i].GetMusicRate();