Skip to content

Commit

Permalink
actually do the save thing for c62833f
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 13, 2020
1 parent d804880 commit be84d66
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/Etterna/Models/Misc/StageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,7 @@ StageStats::FinalizeScores(bool bSummary)
mostrecentscorekey = hs.GetScoreKey();
zzz->m_lastSong.FromSong(GAMESTATE->m_pCurSong);
if (m_bLivePlay) {
PROFILEMAN->SaveLocalProfile(
PROFILEMAN->GetProfile(PLAYER_1)->m_sProfileID);
GAMESTATE->SavePlayerProfile();
}

CHECKPOINT_M("Finished Finalizing Score");
Expand Down
2 changes: 1 addition & 1 deletion src/Etterna/Screen/Others/ScreenDebugOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ class DebugLineWriteProfiles : public IDebugLine
{
auto pn = static_cast<PlayerNumber>(g_ProfileSlot);
GAMESTATE->SaveCurrentSettingsToProfile(pn);
GAMESTATE->SavePlayerProfile(pn);
GAMESTATE->SavePlayerProfile();
IDebugLine::DoAndLog(sMessageOut);
}
};
Expand Down
16 changes: 4 additions & 12 deletions src/Etterna/Singletons/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,21 +433,13 @@ GameState::LoadProfiles(bool bLoadEdits)
}

void
GameState::SavePlayerProfiles()
GameState::SavePlayerProfile()
{
SavePlayerProfile(PLAYER_1);
}

void
GameState::SavePlayerProfile(PlayerNumber pn)
{
// AutoplayCPU should not save scores. -aj
// xxx: this MAY cause issues with Multiplayer. However, without a working
// Multiplayer build, we'll never know. -aj
// AutoplayCPU should not save scores
if (m_pPlayerState->m_PlayerController != PC_HUMAN)
return;

PROFILEMAN->SaveProfile(pn);
PROFILEMAN->SaveProfile(PLAYER_1);
}

bool
Expand Down Expand Up @@ -1792,7 +1784,7 @@ class LunaGameState : public Luna<GameState>

static int SaveProfiles(T* p, lua_State* L)
{
p->SavePlayerProfiles();
p->SavePlayerProfile();
SCREENMAN->ZeroNextUpdate();
COMMON_RETURN_SELF;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Etterna/Singletons/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class GameState
auto JoinInput(PlayerNumber pn) -> bool;
auto JoinPlayers() -> bool;
void LoadProfiles(bool bLoadEdits = true);
void SavePlayerProfiles();
void SavePlayerProfile(PlayerNumber pn);
void SavePlayerProfile();
auto HaveProfileToLoad() -> bool;
auto HaveProfileToSave() -> bool;
void AddStageToPlayer(PlayerNumber pn);
Expand Down

0 comments on commit be84d66

Please sign in to comment.