Skip to content

Commit

Permalink
Fix empty replaydata crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Feb 10, 2018
1 parent 5594f6c commit 58f8c1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,8 @@ Grade HighScore::GetWifeGrade() const {
}

bool HighScore::WriteReplayData() {
return DBProfile::WriteReplayData(this);
//return m_Impl->WriteReplayData();
//return DBProfile::WriteReplayData(this);
return m_Impl->WriteReplayData();
}

// Ok I guess we can be more lenient and convert by midwindow values, but we still have to assume j4 - mina
Expand Down
8 changes: 5 additions & 3 deletions src/StageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,11 @@ void StageStats::FinalizeScores(bool bSummary)
hs.timeStamps.clear();
hs.timeStamps.shrink_to_fit();
}
bool writesuccess = hs.WriteReplayData();
if (writesuccess)
hs.UnloadReplayData();
if (m_player[PLAYER_1].m_fWifeScore > 0.f) {
bool writesuccess = hs.WriteReplayData();
if (writesuccess)
hs.UnloadReplayData();
}
zzz->SetAnyAchievedGoals(GAMESTATE->m_pCurSteps[PLAYER_1]->GetChartKey(), GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate, hs);
mostrecentscorekey = hs.GetScoreKey();
zzz->m_lastSong.FromSong(GAMESTATE->m_pCurSong);
Expand Down

0 comments on commit 58f8c1c

Please sign in to comment.