Handle random entries.

This commit is contained in:
Steve Checkoway
2006-02-21 01:36:49 +00:00
parent f4e1bae560
commit e6a456e1c3
+5 -6
View File
@@ -526,15 +526,14 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
CourseSortSongs( e->songSort, vpPossibleSongs, rnd );
if( e->iChooseIndex < int(vpPossibleSongs.size()) )
{
ASSERT( e->iChooseIndex >= -1 );
if( e->iChooseIndex == -1 )
pResolvedSong = vpPossibleSongs[RandomInt(0, vpPossibleSongs.size()-1)];
else if( e->iChooseIndex < int(vpPossibleSongs.size()) )
pResolvedSong = vpPossibleSongs[e->iChooseIndex];
pResolvedSong->GetSteps( vpPossibleSteps, st, e->baseDifficulty, e->iLowMeter, e->iHighMeter );
}
else
{
continue;
}
pResolvedSong->GetSteps( vpPossibleSteps, st, e->baseDifficulty, e->iLowMeter, e->iHighMeter );
}
ASSERT( !vpPossibleSteps.empty() ); // if no steps are playable, this shouldn't be a possible song