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.
This commit is contained in:
Thierry Crozat 2011-12-07 00:13:08 +00:00
parent 7c81f75d27
commit b419f73973

View File

@ -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);