From a7aa62d82574128cba8fd3c10d29e2bbcfca305d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 4 Jan 2012 20:46:33 +0300 Subject: Allow play gui sound with incorrect paths configured. --- src/sound.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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()); -- cgit v1.2.3-60-g2f50