summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-01 01:15:01 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-01 01:15:01 +0300
commit5cf2b1abffc97e6d0d79dec6088a3b59e07bc490 (patch)
tree3a0c66dcc05a22078be4182dc0f0c3a1247e500f
parent4960f1bd01889d04915b76837dfc3f74ef07ac79 (diff)
downloadmanaplus-5cf2b1abffc97e6d0d79dec6088a3b59e07bc490.tar.gz
manaplus-5cf2b1abffc97e6d0d79dec6088a3b59e07bc490.tar.bz2
manaplus-5cf2b1abffc97e6d0d79dec6088a3b59e07bc490.tar.xz
manaplus-5cf2b1abffc97e6d0d79dec6088a3b59e07bc490.zip
Dont try to play gui sound if it empty.
-rw-r--r--src/soundmanager.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp
index 004cfacdf..c2f522d3e 100644
--- a/src/soundmanager.cpp
+++ b/src/soundmanager.cpp
@@ -483,14 +483,21 @@ void SoundManager::playSfx(const std::string &path,
void SoundManager::playGuiSound(const std::string &name)
{
+ const std::string sound = config.getStringValue(name);
+ if (sound == "(no sound)")
+ return;
playGuiSfx(branding.getStringValue("systemsounds").append(
- config.getStringValue(name)).append(".ogg"));
+ sound).append(".ogg"));
}
void SoundManager::playGuiSfx(const std::string &path)
{
- if (!mInstalled || path.empty() || !mPlayGui)
+ if (!mInstalled ||
+ !mPlayGui ||
+ path.empty())
+ {
return;
+ }
std::string tmpPath;
if (!path.compare(0, 4, "sfx/"))