fixed m_oldMusic.push_back(nullptr) and segfault

dev-ui
andreymal 2014-03-02 18:00:02 +04:00
parent fef338da24
commit 1a0dcedf83
1 changed files with 9 additions and 7 deletions

View File

@ -514,7 +514,6 @@ void ALSound::FrameMove(float delta)
{
continue;
}
if (it.second->IsMuted())
{
it.second->SetVolume(0.0f);
@ -686,12 +685,15 @@ bool ALSound::PlayPauseMusic(const std::string &filename, bool repeat)
{
if (m_previousMusic.fadeTime > 0.0f)
{
OldMusic old;
old.music = m_currentMusic;
old.fadeTime = 2.0f;
old.currentTime = 0.0f;
m_oldMusic.push_back(old);
m_currentMusic = nullptr;
if(m_currentMusic)
{
OldMusic old;
old.music = m_currentMusic;
old.fadeTime = 2.0f;
old.currentTime = 0.0f;
m_oldMusic.push_back(old);
m_currentMusic = nullptr;
}
}
else
{