SCUMM: Check the sound channel is valid, before checking the sound channel.

svn-id: r53562
This commit is contained in:
Travis Howell 2010-10-18 04:25:53 +00:00
parent 34ff826918
commit ada933c2ad

View File

@ -276,7 +276,7 @@ int SoundHE::getSoundVar(int sound, int var) {
chan = i;
}
if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
if (chan != -1 && _mixer->isSoundHandleActive(_heSoundChannels[chan])) {
debug(5, "getSoundVar: sound %d var %d result %d", sound, var, _heChannel[chan].soundVars[var]);
return _heChannel[chan].soundVars[var];
} else {