From c6b4edf8cc635ddcb2a8b3c0cef38dd88fa73768 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Thu, 16 Apr 2009 21:22:46 +0200 Subject: Renamed ResourceManager::moveFile to ResourceManager::copyFile and catched error when it fails. --- src/sound.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sound.cpp') 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()); } -- cgit v1.2.3-70-g09d2