From e25587d74bdd55968e0548192a3dc8b4639a468a Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 6 Jul 2005 17:55:53 +0000 Subject: Fixed stopping sounds. I think that at one point our 'param' used to be unsigned, but it isn't any more. svn-id: r18504 --- saga/sfuncs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'saga/sfuncs.cpp') diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index cfaa4d2f99..cfba54aaad 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -1737,7 +1737,7 @@ void Script::sfPlaySound(SCRIPTFUNC_PARAMS) { int16 param = thread->pop(); int res; - if (param < ARRAYSIZE(sfxTable)) { + if (param >= 0 && param < ARRAYSIZE(sfxTable)) { res = sfxTable[param].res; if (_vm->getFeatures() & GF_CD_FX) res -= 14; @@ -1753,7 +1753,7 @@ void Script::sfPlayLoopedSound(SCRIPTFUNC_PARAMS) { int16 param = thread->pop(); int res; - if (param < ARRAYSIZE(sfxTable)) { + if (param >= 0 && param < ARRAYSIZE(sfxTable)) { res = sfxTable[param].res; if (_vm->getFeatures() & GF_CD_FX) res -= 14; -- cgit v1.2.3