From 0151baf6dc14be2549ad041e5678c56d81b819ea Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 25 May 2004 06:01:52 +0000 Subject: [PATCH] save stats on exit only if there's new data that hasn't yet been saved --- stepmania/src/GameState.cpp | 6 ++++-- stepmania/src/ProfileManager.cpp | 1 - stepmania/src/StepMania.cpp | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index afd42842ce..dd6dac4c82 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -107,8 +107,7 @@ void GameState::ApplyCmdline() void GameState::Reset() { - if( !m_timeGameStarted.IsZero() && g_vPlayedStageStats.size() ) // we were in the middle of a game and played at least one song - EndGame(); + EndGame(); ASSERT( THEME ); @@ -317,6 +316,9 @@ void GameState::EndGame() { LOG->Trace( "GameState::EndGame" ); + if( m_timeGameStarted.IsZero() || !g_vPlayedStageStats.size() ) // we were in the middle of a game and played at least one song + return; + /* Finish the final stage. */ FinishStage(); diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index e5e937ba51..e41daabea0 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -46,7 +46,6 @@ ProfileManager::ProfileManager() ProfileManager::~ProfileManager() { - SaveMachineProfile(); } void ProfileManager::Init() diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 1194864587..a71b36d0d4 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1568,5 +1568,7 @@ static void GameLoop() usleep( 1000 ); // give some time to other processes and threads #endif } + + GAMESTATE->EndGame(); }