summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
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());
}