Skip to content

Commit

Permalink
fix internal scoregrabby function
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Apr 30, 2017
1 parent 798e0b0 commit c9e4e1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,17 +2408,16 @@ void Profile::GetScoresByKey(vector<SongID>& songids, vector<StepsID>& stepsids,
}
}

// new function that uses the chartkey indexed map, wait wtf is going on here -mina
vector<HighScore> Profile::GetScoresByKey(RString ck) {
auto& songids = SONGMAN->SongIDsByChartkey[ck];
auto& stepsids = SONGMAN->StepsIDsByChartkey[ck];
vector<HighScore> o;
if (!HighScoresByChartKey.count(ck))
return o;

for (int i = 0; i < songids.size(); ++i) {
auto& hsfas = m_SongHighScores[songids[i]].m_StepsHighScores;
vector<HighScore>& scores = hsfas[stepsids[i]].hsl.vHighScores;
for (int ii = 0; ii < scores.size(); ++ii) {
o.emplace_back(scores[ii]);
auto &hsrm = HighScoresByChartKey.at(ck);
FOREACHM(float, vector<HighScore>, hsrm, zz) {
auto &hsv = zz->second;
for (size_t ii = 0; ii < hsv.size(); ii++) {
o.emplace_back(hsv[ii]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Profile
void AddToFavorites(RString ck) { FavoritedCharts.emplace_back(ck); }
void RemoveFromFavorites(RString ck);

// doesn't work properly yet - mina
// uses the keyed scoremap -mina
vector<HighScore> GetScoresByKey(RString ck);

// Vector for now, we can make this more efficient later
Expand Down

0 comments on commit c9e4e1f

Please sign in to comment.