diff options
Diffstat (limited to 'src/soundmanager.cpp')
-rw-r--r-- | src/soundmanager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp index 5fc06eb79..b60e84ef3 100644 --- a/src/soundmanager.cpp +++ b/src/soundmanager.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2012 The ManaPlus Developers + * Copyright (C) 2011-2013 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -232,11 +232,14 @@ static SDLMusic *loadMusic(const std::string &fileName) void SoundManager::playMusic(const std::string &fileName) { - mCurrentMusicFile = fileName; - if (!mInstalled || !mPlayMusic) return; + if (mCurrentMusicFile == fileName) + return; + + mCurrentMusicFile = fileName; + haltMusic(); if (!fileName.empty()) @@ -407,6 +410,7 @@ void SoundManager::haltMusic() mMusic->decRef(); mMusic = nullptr; } + mCurrentMusicFile.clear(); } void SoundManager::changeAudio() |