Skip to content

Commit

Permalink
Fix player rating not updating until game restart
Browse files Browse the repository at this point in the history
recalculate rating for every new high score from gameplay, basically
  • Loading branch information
poco0317 committed Nov 24, 2019
1 parent 979e95d commit 25f6e36
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Etterna/Singletons/GameState.cpp
Original file line number Diff line number Diff line change
@@ -557,6 +557,7 @@ GameState::CommitStageStats()
Profile* pPlayerProfile = PROFILEMAN->GetProfile(PLAYER_1);
if (pPlayerProfile)
pPlayerProfile->m_iTotalSessionSeconds += iPlaySeconds;
STATSMAN->AddPlayerStatsToProfile(pPlayerProfile);
}

/* Called by ScreenSelectMusic (etc). Increment the stage counter if we just
9 changes: 1 addition & 8 deletions src/Etterna/Singletons/StatsManager.cpp
Original file line number Diff line number Diff line change
@@ -18,11 +18,6 @@
StatsManager* STATSMAN =
NULL; // global object accessible from anywhere in the program

void
AddPlayerStatsToProfile(Profile* pProfile,
const StageStats& ss,
PlayerNumber pn);

StatsManager::StatsManager()
{
// Register with Lua.
@@ -99,9 +94,7 @@ StatsManager::CalcAccumPlayedStageStats()
// fffff this is back here because some scores/files dont calc properly if
// called during load -mina
void
AddPlayerStatsToProfile(Profile* pProfile,
const StageStats& ss,
PlayerNumber pn)
StatsManager::AddPlayerStatsToProfile(Profile* pProfile)
{
SCOREMAN->CalcPlayerRating(pProfile->m_fPlayerRating,
pProfile->m_fPlayerSkillsets,
1 change: 1 addition & 0 deletions src/Etterna/Singletons/StatsManager.h
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ class StatsManager
StageStats& GetAccumPlayedStageStats() { return m_AccumPlayedStageStats; }

static void CommitStatsToProfiles(const StageStats* pSS);
void AddPlayerStatsToProfile(Profile* pProfile);

void UnjoinPlayer(PlayerNumber pn);
void GetStepsInUse(set<Steps*>& apInUseOut) const;

0 comments on commit 25f6e36

Please sign in to comment.