If a course uses a song that is disabled, disable the course too.
This commit is contained in:
@@ -138,7 +138,8 @@ void CatalogXml::Save( LoadingWindow *loading_window )
|
||||
// the title.
|
||||
if( !pCourse->AllSongsAreFixed() )
|
||||
continue;
|
||||
if( UNLOCKMAN->CourseIsLocked(pCourse) )
|
||||
/* Don't write locked songs to the catalog, but do write disabled songs. */
|
||||
if( UNLOCKMAN->CourseIsLocked(pCourse) & ~LOCKED_DISABLED )
|
||||
continue;
|
||||
iTotalCourses++;
|
||||
}
|
||||
@@ -233,7 +234,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
|
||||
// the title.
|
||||
if( !pCourse->AllSongsAreFixed() )
|
||||
continue;
|
||||
if( UNLOCKMAN->CourseIsLocked(pCourse) )
|
||||
if( UNLOCKMAN->CourseIsLocked(pCourse) & ~LOCKED_DISABLED )
|
||||
continue;
|
||||
|
||||
CourseID courseID;
|
||||
|
||||
@@ -118,6 +118,18 @@ int UnlockManager::CourseIsLocked( const Course *pCourse ) const
|
||||
iRet |= LOCKED_LOCK;
|
||||
}
|
||||
|
||||
/* If a course uses a song that is disabled, disable the course too. */
|
||||
FOREACH_CONST( CourseEntry, pCourse->m_vEntries, e )
|
||||
{
|
||||
const CourseEntry &ce = *e;
|
||||
const Song *pSong = ce.songID.ToSong();
|
||||
if( pSong == NULL )
|
||||
continue;
|
||||
int iSongLock = SongIsLocked( pSong );
|
||||
if( iSongLock & LOCKED_DISABLED )
|
||||
iRet |= LOCKED_DISABLED;
|
||||
}
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user