save stats on exit only if there's new data that hasn't yet been saved

This commit is contained in:
Chris Danford
2004-05-25 06:01:52 +00:00
parent 962cdfc4f0
commit 0151baf6dc
3 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -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();
-1
View File
@@ -46,7 +46,6 @@ ProfileManager::ProfileManager()
ProfileManager::~ProfileManager()
{
SaveMachineProfile();
}
void ProfileManager::Init()
+2
View File
@@ -1568,5 +1568,7 @@ static void GameLoop()
usleep( 1000 ); // give some time to other processes and threads
#endif
}
GAMESTATE->EndGame();
}