From f1f04f512d284d12bf2c59e212800d7c24de323e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Jul 2014 19:55:05 +0300 Subject: Fix background musis if it was enabled by quck enable action. --- src/being/localplayer.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/being/localplayer.cpp') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 28b08a558..52bf2d75d 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -3126,6 +3126,23 @@ void LocalPlayer::navigateClean() tmpLayer->clean(); } +void LocalPlayer::updateMusic() +{ + if (mMap) + { + std::string str = mMap->getObjectData(mX, mY, MapItemType::MUSIC); + if (str.empty()) + str = mMap->getMusicFile(); + if (str != soundManager.getCurrentMusicFile()) + { + if (str.empty()) + soundManager.fadeOutMusic(); + else + soundManager.fadeOutAndPlayMusic(str); + } + } +} + void LocalPlayer::updateCoords() { Being::updateCoords(); @@ -3141,20 +3158,7 @@ void LocalPlayer::updateCoords() socialWindow->updatePortals(); if (viewport) viewport->hideBeingPopup(); - if (mMap) - { - std::string str = mMap->getObjectData(mX, mY, - MapItemType::MUSIC); - if (str.empty()) - str = mMap->getMusicFile(); - if (str != soundManager.getCurrentMusicFile()) - { - if (str.empty()) - soundManager.fadeOutMusic(); - else - soundManager.fadeOutAndPlayMusic(str); - } - } + updateMusic(); } if (mShowNavigePath) -- cgit v1.2.3-70-g09d2