From df7f81c9055328adf5ed69b9e6786ff3593caba4 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 30 Aug 2005 12:25:15 +0000 Subject: The intro asks to play song number 0. I'm almost sure that the music that is supposed to play at this point has resource number 32. _songTable[0] contains the value 32 at this point, so song 0 is probably a valid music request, and not a request to stop the music. At the other end of the list, I believe the song number has to be *less* than _songTableLen, not less or equal to it. But feel free to revert this change if I'm messing things up. svn-id: r18719 --- saga/sfuncs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'saga/sfuncs.cpp') 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); -- cgit v1.2.3