fix attract sounds play when they shouldn't if two ScreenDemonstrations in a row
This commit is contained in:
@@ -53,10 +53,6 @@ void ScreenDemonstration::Init()
|
|||||||
|
|
||||||
GAMESTATE->m_PlayMode = PLAY_MODE_REGULAR;
|
GAMESTATE->m_PlayMode = PLAY_MODE_REGULAR;
|
||||||
|
|
||||||
/* If needed, turn sound off. */
|
|
||||||
if( !GAMESTATE->IsTimeToPlayAttractSounds() )
|
|
||||||
SOUNDMAN->SetPrefs( 0 ); // silent
|
|
||||||
|
|
||||||
ScreenJukebox::Init();
|
ScreenJukebox::Init();
|
||||||
|
|
||||||
if( GAMESTATE->m_pCurSong == NULL ) // we didn't find a song.
|
if( GAMESTATE->m_pCurSong == NULL ) // we didn't find a song.
|
||||||
@@ -87,8 +83,6 @@ void ScreenDemonstration::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
}
|
}
|
||||||
else if( SM == SM_GainFocus )
|
else if( SM == SM_GainFocus )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->IsTimeToPlayAttractSounds() )
|
|
||||||
SOUNDMAN->SetPrefs( 0 ); // silent
|
|
||||||
}
|
}
|
||||||
else if( SM == SM_LoseFocus )
|
else if( SM == SM_LoseFocus )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1131,6 +1131,9 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
|
|||||||
p.StopMode = RageSoundParams::M_CONTINUE;
|
p.StopMode = RageSoundParams::M_CONTINUE;
|
||||||
p.m_StartSecond = fStartSecond;
|
p.m_StartSecond = fStartSecond;
|
||||||
|
|
||||||
|
// Silence music if not playing attract sounds in demonstration.
|
||||||
|
p.m_Volume = (!GAMESTATE->m_bDemonstrationOrJukebox || GAMESTATE->IsTimeToPlayAttractSounds()) ? 1 : 0;
|
||||||
|
|
||||||
ASSERT( !m_pSoundMusic->IsPlaying() );
|
ASSERT( !m_pSoundMusic->IsPlaying() );
|
||||||
m_pSoundMusic->Play( &p );
|
m_pSoundMusic->Play( &p );
|
||||||
if( m_bPaused )
|
if( m_bPaused )
|
||||||
|
|||||||
Reference in New Issue
Block a user