diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2010-09-13 14:19:11 +0200 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2010-09-13 14:19:11 +0200 |
commit | af176c1f344a78a352ecaa6f252054f5ac38ec73 (patch) | |
tree | c4f42886095ca9e2d114e9b403977e6db3cc2cd1 /src/game.cpp | |
parent | e93253b36b73d7335d98a3c73d532a1bbd7212a5 (diff) | |
download | mana-af176c1f344a78a352ecaa6f252054f5ac38ec73.tar.gz mana-af176c1f344a78a352ecaa6f252054f5ac38ec73.tar.bz2 mana-af176c1f344a78a352ecaa6f252054f5ac38ec73.tar.xz mana-af176c1f344a78a352ecaa6f252054f5ac38ec73.zip |
Avoid loading non-existing music and minimaps
Reviewed-by: Thorbjorn
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; |