diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 8bc9ef314c..c06bb273eb 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -87,6 +87,14 @@ void Profile::InitEditableData() m_iWeightPounds = 0; } +void Profile::ClearStats() +{ + // don't reset the Guid + RString sGuid = m_sGuid; + InitAll(); + m_sGuid = sGuid; +} + RString Profile::MakeGuid() { RString s; diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index 4214a52b7a..7a835c0e43 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -296,6 +296,7 @@ public: void InitCalorieData(); void InitRecentSongScores(); void InitRecentCourseScores(); + void ClearStats(); // // Loading and saving diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index 8da61c89e1..1b0e9a6960 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -25,7 +25,6 @@ #include "Profile.h" #include "SongManager.h" #include "GameLoop.h" -#include "ScreenServiceAction.h" #include "song.h" static bool g_bIsDisplayed = false; @@ -711,8 +710,8 @@ class DebugLineClearMachineStats : public IDebugLine virtual RString GetPageName() const { return "Profiles"; } virtual void DoAndMakeSystemMessage( RString &sMessageOut ) { - GameCommand gc; - ClearMachineStats(); + Profile* pProfile = PROFILEMAN->GetMachineProfile(); + pProfile->ClearStats(); IDebugLine::DoAndMakeSystemMessage( sMessageOut ); } }; diff --git a/stepmania/src/ScreenServiceAction.cpp b/stepmania/src/ScreenServiceAction.cpp index 792cc6783d..c07e9960ac 100644 --- a/stepmania/src/ScreenServiceAction.cpp +++ b/stepmania/src/ScreenServiceAction.cpp @@ -29,10 +29,7 @@ static LocalizedString MACHINE_STATS_CLEARED( "ScreenServiceAction", "Machine st RString ClearMachineStats() { Profile* pProfile = PROFILEMAN->GetMachineProfile(); - // don't reset the Guid - RString sGuid = pProfile->m_sGuid; - pProfile->InitAll(); - pProfile->m_sGuid = sGuid; + pProfile->ClearStats(); PROFILEMAN->SaveMachineProfile(); return MACHINE_STATS_CLEARED.GetValue(); } diff --git a/stepmania/src/ScreenServiceAction.h b/stepmania/src/ScreenServiceAction.h index 121b1f2b76..0a19dc3e0c 100644 --- a/stepmania/src/ScreenServiceAction.h +++ b/stepmania/src/ScreenServiceAction.h @@ -8,8 +8,6 @@ #undef FAILED #endif -RString ClearMachineStats(); - #include "ScreenPrompt.h" class ScreenServiceAction : public ScreenPrompt