save stats on exit only if there's new data that hasn't yet been saved
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ ProfileManager::ProfileManager()
|
||||
|
||||
ProfileManager::~ProfileManager()
|
||||
{
|
||||
SaveMachineProfile();
|
||||
}
|
||||
|
||||
void ProfileManager::Init()
|
||||
|
||||
@@ -1568,5 +1568,7 @@ static void GameLoop()
|
||||
usleep( 1000 ); // give some time to other processes and threads
|
||||
#endif
|
||||
}
|
||||
|
||||
GAMESTATE->EndGame();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user