Skip to content

Commit

Permalink
call recalculatessr after gameplay again... because calling it during…
Browse files Browse the repository at this point in the history
… song load hopelessly breaks some scores
  • Loading branch information
MinaciousGrace committed May 30, 2017
1 parent 35a6438 commit 1fa8e3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ ProfileLoadResult Profile::LoadAllFromDir( const RString &sDir, bool bRequireSig
ImportScoresToEtterna();
}

LoadOldEttFromDir(sDir);
//LoadOldEttFromDir(sDir);

CalculateStatsFromScores();
return ProfileLoadResult_Success;
Expand Down Expand Up @@ -1049,6 +1049,7 @@ ProfileLoadResult Profile::LoadEttXmlFromNode(const XNode *xml) {
}

void Profile::CalculateStatsFromScores() {
LOG->Trace("Calculating stats from scores");
vector<HighScore*> all = SCOREMAN->GetAllScores();
float TotalGameplaySeconds = 0.f;
m_iTotalTapsAndHolds = 0;
Expand All @@ -1071,9 +1072,6 @@ void Profile::CalculateStatsFromScores() {
m_iTotalDancePoints = m_iTotalTapsAndHolds * 2;
m_iTotalGameplaySeconds = static_cast<int>(TotalGameplaySeconds);

// for some reason this is a lot slower than it should be when called here...? -mina
SCOREMAN->RecalculateSSRs();

SCOREMAN->CalcPlayerRating(m_fPlayerRating, m_fPlayerSkillsets);
}

Expand Down
4 changes: 2 additions & 2 deletions src/StatsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ void StatsManager::CalcAccumPlayedStageStats()
m_AccumPlayedStageStats = AccumPlayedStageStats( m_vPlayedStageStats );
}

// almost deadcode -mina
// fffff this is back here because some scores/files dont calc properly if called during load -mina
void AddPlayerStatsToProfile( Profile *pProfile, const StageStats &ss, PlayerNumber pn )
{
SCOREMAN->RecalculateSSRs();
SCOREMAN->CalcPlayerRating(pProfile->m_fPlayerRating, pProfile->m_fPlayerSkillsets);
return;
}

void StatsManager::CommitStatsToProfiles( const StageStats *pSS )
Expand Down

0 comments on commit 1fa8e3f

Please sign in to comment.