aboutsummaryrefslogtreecommitdiff
path: root/saga/sfuncs.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-07-06 17:55:53 +0000
committerTorbjörn Andersson2005-07-06 17:55:53 +0000
commite25587d74bdd55968e0548192a3dc8b4639a468a (patch)
treefb0d912ca21b1f355fac361c72c9358ba7c1b91e /saga/sfuncs.cpp
parent8294d21739aa42f8ac0273b10504cc52e394f64d (diff)
downloadscummvm-rg350-e25587d74bdd55968e0548192a3dc8b4639a468a.tar.gz
scummvm-rg350-e25587d74bdd55968e0548192a3dc8b4639a468a.tar.bz2
scummvm-rg350-e25587d74bdd55968e0548192a3dc8b4639a468a.zip
Fixed stopping sounds. I think that at one point our 'param' used to be
unsigned, but it isn't any more. svn-id: r18504
Diffstat (limited to 'saga/sfuncs.cpp')
-rw-r--r--saga/sfuncs.cpp4
1 files changed, 2 insertions, 2 deletions
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;