make AddMines deterministic

This commit is contained in:
Chris Danford
2004-01-02 04:08:25 +00:00
parent 4640fb10ad
commit a9985795a4
+6 -1
View File
@@ -768,6 +768,7 @@ void NoteDataUtil::AddMines( NoteData &in, float fStartBeat, float fEndBeat )
// //
int iRowCount = 0; int iRowCount = 0;
int iPlaceEveryRows = 6;
for( int r=first_row; r<=last_row; r++ ) for( int r=first_row; r<=last_row; r++ )
{ {
if( !in.IsRowEmpty(r) ) if( !in.IsRowEmpty(r) )
@@ -775,13 +776,17 @@ void NoteDataUtil::AddMines( NoteData &in, float fStartBeat, float fEndBeat )
iRowCount++; iRowCount++;
// place every 6 or 7 rows // place every 6 or 7 rows
if( (iRowCount>=7) || (iRowCount>=6 && rand()%2) ) if( iRowCount>=iPlaceEveryRows )
{ {
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
if( in.GetTapNote(t,r) == TAP_TAP ) if( in.GetTapNote(t,r) == TAP_TAP )
in.SetTapNote(t,r,TAP_MINE); in.SetTapNote(t,r,TAP_MINE);
iRowCount = 0; iRowCount = 0;
if( iPlaceEveryRows == 6 )
iPlaceEveryRows = 7;
else
iPlaceEveryRows = 6;
} }
} }
} }