aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/toon/audio.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp
index 90f2e3ae34..2a078b8a23 100644
--- a/engines/toon/audio.cpp
+++ b/engines/toon/audio.cpp
@@ -595,10 +595,10 @@ void AudioManager::killAllAmbientSFX()
if (ambient->_enabled) {
ambient->_enabled = false;
ambient->_id = -1;
-
- if (_channels[ambient->_channel] && _channels[ambient->_channel]->isPlaying()) {
+ if (ambient->_channel >= 0 && _channels[ambient->_channel] && _channels[ambient->_channel]->isPlaying()) {
_channels[ambient->_channel]->stop(false);
}
+ ambient->_channel = -1;
}
}
}