aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Haisch2008-05-12 17:48:56 +0000
committerBenjamin Haisch2008-05-12 17:48:56 +0000
commit31a8d984a4b9ce4fc7906166fa8cbe91d52ee7b2 (patch)
tree5a3687f53b06e871450a840bfa05a5e3d04b40ba
parent08c601ad9754b43da214218bfa0e6e5061cb30dd (diff)
downloadscummvm-rg350-31a8d984a4b9ce4fc7906166fa8cbe91d52ee7b2.tar.gz
scummvm-rg350-31a8d984a4b9ce4fc7906166fa8cbe91d52ee7b2.tar.bz2
scummvm-rg350-31a8d984a4b9ce4fc7906166fa8cbe91d52ee7b2.zip
Sanity checks in RtZ: o1_PLAYMUS and o1_STOPMUS
svn-id: r32068
-rw-r--r--engines/made/scriptfuncs_rtz.cpp6
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;
}