From 2afdaf6705d7e1ea11701c07eaf6429255b6ee4f Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 24 May 2011 21:15:59 -0400 Subject: [PATCH] Don't define a variable until it's needed. Still suspect there's an issue here, but can't identify what. --- src/Player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Player.cpp b/src/Player.cpp index 98483728b7..c65d9ed1d4 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -2940,13 +2940,13 @@ void Player::RandomizeNotes( int iNoteRow ) int iNumOfTracks = m_NoteData.GetNumTracks(); for( int t=0; t+1 < iNumOfTracks; t++ ) { - const int iSwapWith = RandomInt( iNumOfTracks ); - /* Only swap a tap and an empty. */ NoteData::iterator iter = m_NoteData.FindTapNote( t, iNewNoteRow ); if( iter == m_NoteData.end(t) || iter->second.type != TapNote::tap ) continue; + const int iSwapWith = RandomInt( iNumOfTracks ); + // Make sure this is empty. if( m_NoteData.FindTapNote(iSwapWith, iNewNoteRow) != m_NoteData.end(iSwapWith) ) continue;