From be84d669bbfcbbdf140dead164082c3c357f1d1c Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Mon, 13 Jul 2020 13:15:42 -0400 Subject: [PATCH] actually do the save thing for c62833ff2a695594d57ece1e976465e234bd05e4 --- src/Etterna/Models/Misc/StageStats.cpp | 3 +-- src/Etterna/Screen/Others/ScreenDebugOverlay.cpp | 2 +- src/Etterna/Singletons/GameState.cpp | 16 ++++------------ src/Etterna/Singletons/GameState.h | 3 +-- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/Etterna/Models/Misc/StageStats.cpp b/src/Etterna/Models/Misc/StageStats.cpp index 6c9a883eff..e434f60820 100644 --- a/src/Etterna/Models/Misc/StageStats.cpp +++ b/src/Etterna/Models/Misc/StageStats.cpp @@ -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"); diff --git a/src/Etterna/Screen/Others/ScreenDebugOverlay.cpp b/src/Etterna/Screen/Others/ScreenDebugOverlay.cpp index 21c7429ef0..c06675dd49 100644 --- a/src/Etterna/Screen/Others/ScreenDebugOverlay.cpp +++ b/src/Etterna/Screen/Others/ScreenDebugOverlay.cpp @@ -1237,7 +1237,7 @@ class DebugLineWriteProfiles : public IDebugLine { auto pn = static_cast(g_ProfileSlot); GAMESTATE->SaveCurrentSettingsToProfile(pn); - GAMESTATE->SavePlayerProfile(pn); + GAMESTATE->SavePlayerProfile(); IDebugLine::DoAndLog(sMessageOut); } }; diff --git a/src/Etterna/Singletons/GameState.cpp b/src/Etterna/Singletons/GameState.cpp index 06baa38277..f9c1dd6d67 100644 --- a/src/Etterna/Singletons/GameState.cpp +++ b/src/Etterna/Singletons/GameState.cpp @@ -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 @@ -1792,7 +1784,7 @@ class LunaGameState : public Luna static int SaveProfiles(T* p, lua_State* L) { - p->SavePlayerProfiles(); + p->SavePlayerProfile(); SCREENMAN->ZeroNextUpdate(); COMMON_RETURN_SELF; } diff --git a/src/Etterna/Singletons/GameState.h b/src/Etterna/Singletons/GameState.h index c372439228..c955b8f590 100644 --- a/src/Etterna/Singletons/GameState.h +++ b/src/Etterna/Singletons/GameState.h @@ -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);