From 31a8d984a4b9ce4fc7906166fa8cbe91d52ee7b2 Mon Sep 17 00:00:00 2001 From: Benjamin Haisch Date: Mon, 12 May 2008 17:48:56 +0000 Subject: Sanity checks in RtZ: o1_PLAYMUS and o1_STOPMUS svn-id: r32068 --- engines/made/scriptfuncs_rtz.cpp | 6 ++++-- 1 file 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; } -- cgit v1.2.3