* Fix for issue #122 with sound not being played in menu after playing mission

dev-ui
erihel 2013-03-14 21:30:32 +01:00
parent 47e7904bb7
commit 6c783b9033
2 changed files with 9 additions and 4 deletions

View File

@ -1146,6 +1146,7 @@ void CRobotMain::ChangePhase(Phase phase)
if (m_phase == PHASE_WIN)
{
m_sound->StopAll();
if (m_endingWinRank == -1)
{
ChangePhase(PHASE_TERM);
@ -1192,13 +1193,13 @@ void CRobotMain::ChangePhase(Phase phase)
{
m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
}
StartMusic();
}
m_sound->StopAll();
StartMusic();
}
if (m_phase == PHASE_LOST)
{
m_sound->StopAll();
if (m_endingLostRank == -1)
{
ChangePhase(PHASE_TERM);
@ -1215,9 +1216,9 @@ void CRobotMain::ChangePhase(Phase phase)
ddim.x = dim.x*2; ddim.y = dim.y*2;
m_interface->CreateButton(pos, ddim, 16, EVENT_BUTTON_OK);
m_displayText->DisplayError(INFO_LOST, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
StartMusic();
}
m_sound->StopAll();
StartMusic();
}
if (m_phase == PHASE_LOADING)

View File

@ -745,6 +745,10 @@ pb->SetState(STATE_SHADOW);
m_phase == PHASE_USER ||
m_phase == PHASE_PROTO )
{
if (!m_sound->IsPlayingMusic()) {
m_sound->PlayMusic(11, true);
}
if ( m_phase == PHASE_TRAINER ) m_index = 0;
if ( m_phase == PHASE_DEFI ) m_index = 1;
if ( m_phase == PHASE_MISSION ) m_index = 2;