The distinction between a random course entry and a nonfixed one is not clear. A newly created course entry would have IsRandomSong() return false yet when placed in a course, the course would return AllSongsFixed() as false. Redefine a random song to be pSong = NULL.
Remove the sentinel value since the songs are already shuffled. Picking the first one is enough.
This commit is contained in:
@@ -513,10 +513,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
||||
|
||||
CourseSortSongs( e->songSort, vpPossibleSongs, rnd );
|
||||
|
||||
ASSERT( e->iChooseIndex >= -1 );
|
||||
if( e->iChooseIndex == -1 )
|
||||
pResolvedSong = vpPossibleSongs[RandomInt(0, vpPossibleSongs.size()-1)];
|
||||
else if( e->iChooseIndex < int(vpPossibleSongs.size()) )
|
||||
ASSERT( e->iChooseIndex >= 0 );
|
||||
if( e->iChooseIndex < int(vpPossibleSongs.size()) )
|
||||
pResolvedSong = vpPossibleSongs[e->iChooseIndex];
|
||||
else
|
||||
continue;
|
||||
@@ -674,7 +672,7 @@ bool Course::AllSongsAreFixed() const
|
||||
{
|
||||
FOREACH_CONST( CourseEntry, m_vEntries, e )
|
||||
{
|
||||
if( e->pSong == NULL )
|
||||
if( !e->IsFixedSong() )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user