diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-04 20:46:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-04 20:46:33 +0300 |
commit | a7aa62d82574128cba8fd3c10d29e2bbcfca305d (patch) | |
tree | 135586fea2299bf40eee2c118506233752d43565 /src/sound.cpp | |
parent | 34e1023596c61c4dfd6279cde1f97b318e04e3fd (diff) | |
download | mv-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.cpp | 8 |
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()); |