Simplify.
This commit is contained in:
@@ -77,18 +77,14 @@ bool UnlockSystem::CourseIsLocked( const Course *course )
|
|||||||
bool UnlockSystem::SongIsLocked( const Song *song )
|
bool UnlockSystem::SongIsLocked( const Song *song )
|
||||||
{
|
{
|
||||||
SongEntry *p = FindSong( song );
|
SongEntry *p = FindSong( song );
|
||||||
|
if( p == NULL )
|
||||||
|
return false;
|
||||||
|
|
||||||
CString tmp;
|
|
||||||
|
|
||||||
if (p)
|
|
||||||
{
|
|
||||||
p->updateLocked();
|
p->updateLocked();
|
||||||
|
|
||||||
if (!p->isLocked) tmp = "un";
|
LOG->Trace( "current status: %slocked", p->isLocked? "":"un" );
|
||||||
LOG->Trace( "current status: %slocked", tmp.c_str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
return (p != NULL) && (p->isLocked);
|
return p->isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UnlockSystem::SongIsRoulette( const Song *song )
|
bool UnlockSystem::SongIsRoulette( const Song *song )
|
||||||
@@ -107,9 +103,8 @@ bool UnlockSystem::SongIsRoulette( const Song *song )
|
|||||||
|
|
||||||
SongEntry *UnlockSystem::FindSong( CString songname )
|
SongEntry *UnlockSystem::FindSong( CString songname )
|
||||||
{
|
{
|
||||||
songname.MakeUpper();
|
for(unsigned i = 0; i < m_SongEntries.size(); i++)
|
||||||
for(int i = 0; i < m_SongEntries.size(); i++)
|
if (!songname.CompareNoCase(m_SongEntries[i].m_sSongName))
|
||||||
if (songname == m_SongEntries[i].m_sSongName)
|
|
||||||
return &m_SongEntries[i];
|
return &m_SongEntries[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -119,12 +114,9 @@ SongEntry *UnlockSystem::FindCourse( const Course *pCourse )
|
|||||||
{
|
{
|
||||||
CString CourseName = pCourse->m_sTranslitName;
|
CString CourseName = pCourse->m_sTranslitName;
|
||||||
|
|
||||||
CourseName.MakeUpper();
|
|
||||||
|
|
||||||
for(unsigned i = 0; i < m_SongEntries.size(); i++)
|
for(unsigned i = 0; i < m_SongEntries.size(); i++)
|
||||||
{
|
{
|
||||||
|
if( !CourseName.CompareNoCase(m_SongEntries[i].m_sSongName) )
|
||||||
if( CourseName == m_SongEntries[i].m_sSongName )
|
|
||||||
return &m_SongEntries[i];
|
return &m_SongEntries[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user