use enum for attract sound frequency

This commit is contained in:
Chris Danford
2005-06-11 10:53:16 +00:00
parent b45f4c0d5a
commit 386de4e74c
5 changed files with 7 additions and 11 deletions
+2 -8
View File
@@ -1720,17 +1720,11 @@ bool GameState::OneIsHot() const
bool GameState::IsTimeToPlayAttractSounds()
{
// if m_iNumTimesThroughAttract is negative, play attract sounds regardless
// of m_iAttractSoundFrequency.
if( m_iNumTimesThroughAttract<0 )
return true;
// 0 means "never play sound". Avoid a divide by 0 below.
if( PREFSMAN->m_iAttractSoundFrequency == 0 )
if( PREFSMAN->m_AttractSoundFrequency == PrefsManager::ASF_NEVER )
return false;
// play attract sounds once every m_iAttractSoundFrequency times through
if( (m_iNumTimesThroughAttract % PREFSMAN->m_iAttractSoundFrequency)==0 )
if( (m_iNumTimesThroughAttract % PREFSMAN->m_AttractSoundFrequency)==0 )
return true;
return false;