From c6ccc82b9835ad258303995618df63d1ff7f7bba Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 Feb 2003 02:45:01 +0000 Subject: [PATCH] Keep track of played and passed songs separately; it's too much of a hassle to try to derive one from the other. always record m_SelectedOptions on the first song played --- stepmania/src/ScreenGameplay.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index c8495d1566..e8a9ba07de 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -510,6 +510,13 @@ bool ScreenGameplay::IsLastSong() void ScreenGameplay::LoadNextSong() { GAMESTATE->ResetMusicStatistics(); + int p; + for( p=0; pm_CurStageStats.iSongsPlayed[p] == 0 ) + GAMESTATE->m_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p]; + } switch( GAMESTATE->m_PlayMode ) { @@ -519,14 +526,9 @@ void ScreenGameplay::LoadNextSong() case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { - int p; for( p=0; pm_CurStageStats.iSongsPassed[p]+1) ); - // If it's the first song, record the options the player selected for later. - if( GAMESTATE->m_CurStageStats.iSongsPassed[p] == 0 ) - GAMESTATE->m_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p]; - } + m_textCourseSongNumber[p].SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iSongsPlayed[p]+1) ); + int iPlaySongIndex = GAMESTATE->GetCourseSongIndex(); iPlaySongIndex %= m_apCourseSongs.size(); GAMESTATE->m_pCurSong = m_apCourseSongs[iPlaySongIndex]; @@ -552,7 +554,7 @@ void ScreenGameplay::LoadNextSong() m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() ); - for( int p=0; pIsPlayerEnabled(p) ) continue; @@ -1226,8 +1228,14 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) } for( p=0; pIsPlayerEnabled(p) && !GAMESTATE->m_CurStageStats.bFailed[p] ) + { + if( !GAMESTATE->IsPlayerEnabled(p) ) + continue; + + GAMESTATE->m_CurStageStats.iSongsPlayed[p]++; + if( !GAMESTATE->m_CurStageStats.bFailed[p] ) GAMESTATE->m_CurStageStats.iSongsPassed[p]++; + } if( !IsLastSong() ) {