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:
Michael Votaw
2024-03-06 01:45:26 -08:00
committed by teejusb
parent 44d3711743
commit f8ce3c7db2
+11 -7
View File
@@ -83,14 +83,18 @@ 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)
{ {
return false; DisplayBpms bpms;
} pSong->GetDisplayBpms(bpms);
if(bpms.GetMax() > m_fMaxBPM)
if( m_fMinBPM != -1 && pSong->m_fSpecifiedBPMMin < m_fMinBPM ) {
{ return false;
return false; }
if(bpms.GetMin() < m_fMinBPM)
{
return false;
}
} }
if( m_fMinDurationSeconds != -1 && pSong->m_fMusicLengthSeconds < m_fMinDurationSeconds ) if( m_fMinDurationSeconds != -1 && pSong->m_fMusicLengthSeconds < m_fMinDurationSeconds )