From 29d2ceb5b593351362bd4135303becf237363832 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 22 Feb 2004 02:16:02 +0000 Subject: [PATCH] simplify --- stepmania/src/GameState.cpp | 38 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) 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();