diff options
Diffstat (limited to 'saga/sfuncs.cpp')
-rw-r--r-- | saga/sfuncs.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index ec0020967c..32b1f14ae5 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -1643,13 +1643,13 @@ void Script::sfPlayMusic(SCRIPTFUNC_PARAMS) { int16 param1 = thread->pop(); int16 param2 = thread->pop(); - if (param1 < 1) { + if (param1 < 0) { _vm->_music->stop(); return; } - if (param1 > _vm->_music->_songTableLen) { - warning("sfPlayMusic: Wrong song number (%d > %d)", param1, _vm->_music->_songTableLen); + if (param1 >= _vm->_music->_songTableLen) { + warning("sfPlayMusic: Wrong song number (%d > %d)", param1, _vm->_music->_songTableLen - 1); } else { _vm->_music->setVolume(-1, 1); _vm->_music->play(_vm->_music->_songTable[param1], param2 ? MUSIC_LOOP: MUSIC_NORMAL); |