Skip to content

Commit

Permalink
Fix replaydata not working if picking 2 different scores from 1 user
Browse files Browse the repository at this point in the history
all replays in the lists should work now :)
  • Loading branch information
poco0317 committed May 22, 2020
1 parent 20e5fae commit f3a5832
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Etterna/Singletons/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,10 +1538,13 @@ DownloadManager::RequestReplayData(const string& scoreid,
}
}
auto& lbd = DLMAN->chartLeaderboards[chartkey];
auto it = find_if(
lbd.begin(), lbd.end(), [userid, username](OnlineScore& a) {
return a.userid == userid && a.username == username;
});
auto it = find_if(lbd.begin(),
lbd.end(),
[userid, username, scoreid](OnlineScore& a) {
return a.userid == userid &&
a.username == username &&
a.scoreid == scoreid;
});
if (it != lbd.end()) {
it->hs.SetOnlineReplayTimestampVector(timestamps);
it->hs.SetOffsetVector(offsets);
Expand All @@ -1558,9 +1561,10 @@ DownloadManager::RequestReplayData(const string& scoreid,
}

auto& lbd = DLMAN->chartLeaderboards[chartkey];
auto it =
find_if(lbd.begin(), lbd.end(), [userid, username](OnlineScore& a) {
return a.userid == userid && a.username == username;
auto it = find_if(
lbd.begin(), lbd.end(), [userid, username, scoreid](OnlineScore& a) {
return a.userid == userid && a.username == username &&
a.scoreid == scoreid;
});
if (it != lbd.end()) {
it->hs.SetOnlineReplayTimestampVector(timestamps);
Expand Down

0 comments on commit f3a5832

Please sign in to comment.