From af176c1f344a78a352ecaa6f252054f5ac38ec73 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Mon, 13 Sep 2010 14:19:11 +0200 Subject: Avoid loading non-existing music and minimaps Reviewed-by: Thorbjorn --- src/game.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 026b0017..8e856dc0 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -958,7 +958,12 @@ void Game::changeMap(const std::string &mapPath) std::string oldMusic = mCurrentMap ? mCurrentMap->getMusicFile() : ""; std::string newMusic = newMap ? newMap->getMusicFile() : ""; if (newMusic != oldMusic) - sound.playMusic(newMusic); + { + if (newMusic.empty()) + sound.stopMusic(); + else + sound.playMusic(newMusic); + } delete mCurrentMap; mCurrentMap = newMap; -- cgit v1.2.3-70-g09d2