fix up a rather fear-inspiring conditional

This commit is contained in:
Glenn Maynard
2003-04-20 01:31:13 +00:00
parent fef2766100
commit 15e6234625
+13 -6
View File
@@ -697,14 +697,21 @@ void Song::ReCalculateRadarValuesAndLastBeat()
void Song::GetNotes( vector<Notes*>& arrayAddTo, NotesType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const void Song::GetNotes( vector<Notes*>& arrayAddTo, NotesType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const
{ {
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes
if( m_apNotes[i]->m_NotesType == nt ) {
if( dc==DIFFICULTY_INVALID || dc==m_apNotes[i]->GetDifficulty() ) if( m_apNotes[i]->m_NotesType != nt ) continue;
if( iMeterLow==-1 || iMeterLow<=m_apNotes[i]->GetMeter() ) if( dc != DIFFICULTY_INVALID && dc != m_apNotes[i]->GetDifficulty() )
if( iMeterHigh==-1 || iMeterHigh>=m_apNotes[i]->GetMeter() ) continue;
if( sDescription=="" || sDescription==m_apNotes[i]->GetDescription() ) if( iMeterLow != -1 && iMeterLow > m_apNotes[i]->GetMeter() )
if( bIncludeAutoGen || !m_apNotes[i]->IsAutogen() ) continue;
if( iMeterHigh != -1 && iMeterHigh < m_apNotes[i]->GetMeter() )
continue;
if( sDescription != "" && sDescription != m_apNotes[i]->GetDescription() )
continue;
if( !bIncludeAutoGen && m_apNotes[i]->IsAutogen() )
continue;
arrayAddTo.push_back( m_apNotes[i] ); arrayAddTo.push_back( m_apNotes[i] );
} }
}
Notes* Song::GetNotes( NotesType nt, Difficulty dc, bool bIncludeAutoGen ) const Notes* Song::GetNotes( NotesType nt, Difficulty dc, bool bIncludeAutoGen ) const
{ {