Skip to content

Commit

Permalink
use an "import" function rather than the same add score function when…
Browse files Browse the repository at this point in the history
… adding imported scores, in case diffrentiation is later needed
  • Loading branch information
MinaciousGrace committed Jun 2, 2017
1 parent 6cbd15e commit 22b7fc9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ void Profile::ImportScoresToEtterna() {
HighScore hs = hsv[i];
// ignore historic key and just load from here since the hashing function was changed anyway
hs.SetChartKey(ck);
SCOREMAN->AddScore(hs);
SCOREMAN->ImportScore(hs);
++loaded;
}
continue;
Expand Down Expand Up @@ -2055,7 +2055,7 @@ void Profile::ImportScoresToEtterna() {
if (matched) {
ck = steps->GetChartKey();
loaded++;
SCOREMAN->AddScore(tmp);
SCOREMAN->ImportScore(tmp);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/ScoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ HighScore* ScoreManager::GetTopSSRHighScore(unsigned int rank, int ss) {
return NULL;
}

void ScoreManager::ImportScore(const HighScore& hs_) {
HighScore hs = hs_;

// don't import duplicated scores
// this may have strange ramifications - mina
// actually i'll just disable this for the time being and give myself time to test it later
//if(!ScoresByKey.count(hs.GetScoreKey()))

pscores[hs.GetChartKey()].AddScore(hs);
}




Expand Down
1 change: 1 addition & 0 deletions src/ScoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class ScoreManager

// for scores achieved during this session
void AddScore(const HighScore& hs_) { HighScore hs = hs_; pscores[hs.GetChartKey()].AddScore(hs); }
void ImportScore(const HighScore& hs_);

// don't save scores under this percentage
float minpercent = PREFSMAN->m_fMinPercentToSaveScores;
Expand Down

0 comments on commit 22b7fc9

Please sign in to comment.