aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThierry Crozat2011-12-07 00:13:08 +0000
committerThierry Crozat2011-12-07 07:59:19 +0000
commitb419f739734b5f63cd4b6cf241b0a36a4fb6c7be (patch)
tree080c0a0b0c5532a12bdb8e526396294fadd44430 /engines
parent7c81f75d276c2f6897780172df61b9cbea7b2719 (diff)
downloadscummvm-rg350-b419f739734b5f63cd4b6cf241b0a36a4fb6c7be.tar.gz
scummvm-rg350-b419f739734b5f63cd4b6cf241b0a36a4fb6c7be.tar.bz2
scummvm-rg350-b419f739734b5f63cd4b6cf241b0a36a4fb6c7be.zip
CGE: Fix issue with music not stopping when reloading game
If you turn off the music and then save a game, then turn on the music again and then load the saved game, the music from the scene continue to play despite the _music flag being false. So the first time you click on the music on/off button the music restart and only the second time does it stop. This fixes the bug by stoping the music before reloading a game.
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/cge_main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index c8ff1ee001..fd7dd85c57 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -279,6 +279,10 @@ Common::Error CGEEngine::loadGameState(int slot) {
sceneDown();
_hero->park();
resetGame();
+
+ // If music is playing, kill it.
+ if (_music)
+ _midiPlayer->killMidi();
// Load the game
loadGame(slot, NULL);