summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-04-16 21:22:46 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-04-16 21:24:41 +0200
commitc6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768 (patch)
treee27d5070ac8631f965e52787be2777ac06c4d516 /src/sound.cpp
parent3fb7414240a4dd48e39f840dc766e2bb29fad41d (diff)
downloadmana-client-c6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768.tar.gz
mana-client-c6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768.tar.bz2
mana-client-c6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768.tar.xz
mana-client-c6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768.zip
Renamed ResourceManager::moveFile to ResourceManager::copyFile and catched error when it fails.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 39651045..e2663fa8 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -149,8 +149,13 @@ static Mix_Music *loadMusic(const std::string &filename)
// it to a temporary physical file so that SDL_mixer can stream it.
logger->log("Loading music \"%s\" from temporary file tempMusic.ogg",
path.c_str());
- resman->moveFile("music/" + filename, "tempMusic.ogg");
- path = resman->getPath("tempMusic.ogg");
+ bool success = resman->copyFile("music/" + filename, "tempMusic.ogg");
+ if (success)
+ {
+ path = resman->getPath("tempMusic.ogg");
+ } else {
+ return NULL;
+ }
} else {
logger->log("Loading music \"%s\"", path.c_str());
}