diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 4c9c3af413..986659212d 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -221,19 +221,6 @@ void GameState::EndGame() continue; CHECKPOINT; - unsigned i; - for( i=0; im_iNumSongsPlayedByPlayMode[ss.playMode]++; - pMachineProfile->m_iNumSongsPlayedByStyle[ss.style]++; - pMachineProfile->m_iNumSongsPlayedByDifficulty[ss.pSteps[p]->GetDifficulty()]++; - int iMeter = clamp( ss.iMeter[p], 0, MAX_METER ); - pMachineProfile->m_iNumSongsPlayedByMeter[ iMeter ]++; - } Profile* pPlayerProfile = PROFILEMAN->GetProfile( (PlayerNumber)p ); if( pPlayerProfile ) @@ -245,25 +232,34 @@ void GameState::EndGame() PREFSMAN->m_bComboContinuesBetweenSongs ? g_CurStageStats.iCurCombo[p] : 0; - - for( i=0; im_iNumSongsPlayedByPlayMode[ss.playMode]++; + pMachineProfile->m_iNumSongsPlayedByStyle[ss.style]++; + pMachineProfile->m_iNumSongsPlayedByDifficulty[ss.pSteps[p]->GetDifficulty()]++; + pMachineProfile->m_iNumSongsPlayedByMeter[iMeter]++; + + if( pPlayerProfile ) + { pPlayerProfile->m_iNumSongsPlayedByPlayMode[ss.playMode]++; pPlayerProfile->m_iNumSongsPlayedByStyle[ss.style]++; pPlayerProfile->m_iNumSongsPlayedByDifficulty[ss.pSteps[p]->GetDifficulty()]++; - int iMeter = clamp( ss.iMeter[p], 0, MAX_METER ); pPlayerProfile->m_iNumSongsPlayedByMeter[iMeter]++; } } CHECKPOINT; - MEMCARDMAN->FlushAllDisks(); } CHECKPOINT; + MEMCARDMAN->FlushAllDisks(); + CHECKPOINT; BOOKKEEPER->WriteToDisk(); PROFILEMAN->SaveMachineProfile();