Skip to content

Commit

Permalink
WE CANT DO THIS POINTERS GET WRECKED IN DLMAN IF WE DO
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Apr 17, 2020
1 parent 0f6081b commit 7621d85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/Etterna/Singletons/ScoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,20 @@ ScoresAtRate::GetSortedKeys()
return o;
}

const vector<HighScore*>&
const vector<HighScore*>
ScoresAtRate::GetAllScores()
{
vector<HighScore*> o;
FOREACHUM(string, HighScore, scores, i)
o.push_back(&i->second);

// upload the worst scores first and the best scores last
// so we catch any de-facto pbs that are created by actual
// pbs failing the upload checks for w.e reason
auto ssrcomp = [](HighScore* a, HighScore* b) {
return (a->GetSSRNormPercent() < b->GetSSRNormPercent());
};
sort(o.begin(), o.end(), ssrcomp);
return o;
}

Expand Down Expand Up @@ -277,7 +285,7 @@ ScoresForChart::GetAllPBPtrs()
return o;
}

const vector<HighScore*>&
const vector<HighScore*>
ScoresForChart::GetAllScores()
{
vector<HighScore*> o;
Expand Down
4 changes: 2 additions & 2 deletions src/Etterna/Singletons/ScoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ScoresAtRate
const float& rate,
const string& profileID);

const vector<HighScore*>& GetAllScores();
const vector<HighScore*> GetAllScores();
unordered_map<string, HighScore> scores;

private:
Expand Down Expand Up @@ -72,7 +72,7 @@ struct ScoresForChart
Chart ch;

ScoresAtRate* GetScoresAtRate(const int& rate);
const vector<HighScore*>& GetAllScores();
const vector<HighScore*> GetAllScores();
XNode* CreateNode(const string& ck) const;
void LoadFromNode(const XNode* node,
const string& ck,
Expand Down

0 comments on commit 7621d85

Please sign in to comment.