Don't define a variable until it's needed.

Still suspect there's an issue here, but can't identify what.
This commit is contained in:
Jason Felds
2011-05-24 21:15:59 -04:00
parent ded36d6f19
commit 2afdaf6705
+2 -2
View File
@@ -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;