Skip to content

Commit

Permalink
Merge branch '0.55.1.oops'
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Sep 25, 2017
2 parents 0c2a3b6 + fc238bc commit f31f334
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ HighScoreImpl::HighScoreImpl()
iScore = 0;
fPercentDP = 0.f;
fWifeScore = 0.f;
fSSRNormPercent = 11111.f;
fSSRNormPercent = 0.f;
fMusicRate = 0.f;
fJudgeScale = 0.f;
bEtternaValid = true;
Expand Down Expand Up @@ -824,7 +824,7 @@ void HighScore::LoadFromNode( const XNode* pNode )
m_Impl->bEtternaValid = false;
}

if (m_Impl->fSSRNormPercent == 11111.f) {
if (m_Impl->fSSRNormPercent > 1000.f) {
if (m_Impl->grade != Grade_Failed)
m_Impl->fSSRNormPercent = RescoreToWifeJudgeDuringLoad(4);
else
Expand Down
33 changes: 21 additions & 12 deletions src/ScoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void ScoreManager::RecalculateSSRs(LoadingWindow *ld) {
++scoreindex;

HighScore* hs = AllScores[i];
if (hs->GetSSRCalcVersion() == GetCalcVersion())
if (hs->GetSSRCalcVersion() == 236) // temp hack
continue;

Steps* steps = SONGMAN->GetStepsByChartkey(hs->GetChartKey());
Expand Down Expand Up @@ -253,7 +253,7 @@ void ScoreManager::RecalculateSSRs(LoadingWindow *ld) {
auto dakine = MinaSDCalc(serializednd, steps->GetNoteData().GetNumTracks(), musicrate, ssrpercent, 1.f, td->HasWarps());
FOREACH_ENUM(Skillset, ss)
hs->SetSkillsetSSR(ss, dakine[ss]);
hs->SetSSRCalcVersion(GetCalcVersion());
hs->SetSSRCalcVersion(236); // temp hack

td->UnsetEtaner();
nd.UnsetNerv();
Expand All @@ -273,7 +273,9 @@ void ScoreManager::RecalculateSSRs(LoadingWindow *ld) {
totalscorenotes += hs->GetTapNoteScore(TNS_Miss);

if (totalstepsnotes - totalscorenotes == 0)
hs->SetChordCohesion(1); // we are setting nochordcohesion to 1 here, functions should be renamed? -mina
hs->SetChordCohesion(1); // the set function isn't inverted but the get function is, this sets bnochordcohesion to 1
else
hs->SetChordCohesion(0);
}
return;
}
Expand Down Expand Up @@ -322,7 +324,7 @@ float ScoreManager::AggregateSSRs(Skillset ss, float rating, float res, int iter
rating += res;
sum = 0.0;
for (int i = 0; i < static_cast<int>(TopSSRs.size()); i++) {
if(TopSSRs[i]->GetSSRCalcVersion() == GetCalcVersion() && TopSSRs[i]->GetEtternaValid())
if(TopSSRs[i]->GetSSRCalcVersion() == 236 && TopSSRs[i]->GetEtternaValid()) // temp hack
sum += max(0.0, 2.f / erfc(0.1*(TopSSRs[i]->GetSkillsetSSR(ss) - rating)) - 1.5);
}
} while (pow(2, rating * 0.1) < sum);
Expand Down Expand Up @@ -390,8 +392,11 @@ XNode* ScoresAtRate::CreateNode(const int& rate) const {
string rs = ssprintf("%.3f", static_cast<float>(rate) / 10000.f);
// should be safe as this is only called if there is at least 1 score (which would be the pb)
o->AppendAttr("PBKey", PBptr->GetScoreKey());
if(noccPBptr != nullptr && PBptr->GetScoreKey() != noccPBptr->GetScoreKey()) // don't write unless it's different from the pbkey -mina
o->AppendAttr("noccPBKey", noccPBptr->GetScoreKey());
if (noccPBptr != nullptr) {
if(PBptr->GetScoreKey() != noccPBptr->GetScoreKey())
o->AppendAttr("noccPBKey", noccPBptr->GetScoreKey()); // don't write unless it's different from the pbkey -mina
}

o->AppendAttr("BestGrade", GradeToString(bestGrade));
o->AppendAttr("Rate", rs);

Expand Down Expand Up @@ -439,13 +444,17 @@ void ScoresAtRate::LoadFromNode(const XNode* node, const string& ck, const float
PBptr = &scores.find(sk)->second;
}

// Set any nocc pb
if (noccPBptr == nullptr)
noccPBptr = &scores.find(sk)->second;
else {
// update nocc pb if a better score is found
if (noccPBptr->GetWifeScore() < scores[sk].GetWifeScore() && scores[sk].GetChordCohesion() == 1)
// lurker says:
// don't even TRY to fuck with nocc pb unless the score is nocc
if (scores[sk].GetChordCohesion() == 0) {
// Set any nocc pb
if (noccPBptr == nullptr)
noccPBptr = &scores.find(sk)->second;
else {
// update nocc pb if a better score is found
if (noccPBptr->GetSSRNormPercent() < scores[sk].GetSSRNormPercent())
noccPBptr = &scores.find(sk)->second;
}
}

// Fill in stuff for the highscores
Expand Down

0 comments on commit f31f334

Please sign in to comment.