summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-04 20:46:33 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-04 20:46:33 +0300
commita7aa62d82574128cba8fd3c10d29e2bbcfca305d (patch)
tree135586fea2299bf40eee2c118506233752d43565 /src/sound.cpp
parent34e1023596c61c4dfd6279cde1f97b318e04e3fd (diff)
downloadmv-a7aa62d82574128cba8fd3c10d29e2bbcfca305d.tar.gz
mv-a7aa62d82574128cba8fd3c10d29e2bbcfca305d.tar.bz2
mv-a7aa62d82574128cba8fd3c10d29e2bbcfca305d.tar.xz
mv-a7aa62d82574128cba8fd3c10d29e2bbcfca305d.zip
Allow play gui sound with incorrect paths configured.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index a573458ef..7448624dd 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -349,9 +349,13 @@ void Sound::playGuiSfx(const std::string &path)
if (!mInstalled || path.empty() || !mPlayGui)
return;
+ std::string tmpPath;
+ if (!path.compare(0, 4, "sfx/"))
+ tmpPath = path;
+ else
+ tmpPath = paths.getValue("sfx", "sfx/") + path;
ResourceManager *resman = ResourceManager::getInstance();
- SoundEffect *sample = resman->getSoundEffect(
- paths.getStringValue("sfx") + path);
+ SoundEffect *sample = resman->getSoundEffect(tmpPath);
if (sample)
{
logger->log("Sound::playGuiSfx() Playing: %s", path.c_str());