Explicitly get song bpm when checking if song matches songCriteria (m_fSpecifiedBPMMax and m_fSpecifiedBPMMin are only set if #DISPLAYBPM is used in simfile)
This commit is contained in:
+7
-3
@@ -83,15 +83,19 @@ bool SongCriteria::Matches( const Song *pSong ) const
|
|||||||
if( m_iMaxStagesForSong != -1 && GAMESTATE->GetNumStagesMultiplierForSong(pSong) > m_iMaxStagesForSong )
|
if( m_iMaxStagesForSong != -1 && GAMESTATE->GetNumStagesMultiplierForSong(pSong) > m_iMaxStagesForSong )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_fMaxBPM != -1 && pSong->m_fSpecifiedBPMMax > m_fMaxBPM )
|
if(m_fMaxBPM != -1 && m_fMinBPM != -1)
|
||||||
|
{
|
||||||
|
DisplayBpms bpms;
|
||||||
|
pSong->GetDisplayBpms(bpms);
|
||||||
|
if(bpms.GetMax() > m_fMaxBPM)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(bpms.GetMin() < m_fMinBPM)
|
||||||
if( m_fMinBPM != -1 && pSong->m_fSpecifiedBPMMin < m_fMinBPM )
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( m_fMinDurationSeconds != -1 && pSong->m_fMusicLengthSeconds < m_fMinDurationSeconds )
|
if( m_fMinDurationSeconds != -1 && pSong->m_fMusicLengthSeconds < m_fMinDurationSeconds )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user