diff options
-rw-r--r-- | engines/made/scriptfuncs_rtz.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/made/scriptfuncs_rtz.cpp b/engines/made/scriptfuncs_rtz.cpp index 4c55fe5182..424ec1cb5d 100644 --- a/engines/made/scriptfuncs_rtz.cpp +++ b/engines/made/scriptfuncs_rtz.cpp @@ -280,15 +280,17 @@ int16 ScriptFunctionsRtz::o1_PLAYMUS(int16 argc, int16 *argv) { int16 musicNum = argv[0]; if (musicNum > 0) { _xmidiRes = _vm->_res->getXmidi(musicNum); - _vm->_music->playXMIDI(_xmidiRes); + if (_xmidiRes) + _vm->_music->playXMIDI(_xmidiRes); } return 0; } int16 ScriptFunctionsRtz::o1_STOPMUS(int16 argc, int16 *argv) { - if (_vm->_music->isPlaying()) { + if (_vm->_music->isPlaying() && _xmidiRes) { _vm->_music->stop(); _vm->_res->freeResource(_xmidiRes); + _xmidiRes = NULL; } return 0; } |