From b419f739734b5f63cd4b6cf241b0a36a4fb6c7be Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 7 Dec 2011 00:13:08 +0000 Subject: 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. --- engines/cge/cge_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/cge') 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); -- cgit v1.2.3