aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2015-01-16 14:08:15 +0200
committerFilippos Karapetis2015-01-16 14:08:15 +0200
commit9f00880aa40abb7584a007e10591ee5aa593ae7a (patch)
tree61223646edbfa07a7342e64a51c22ff7be1a1982
parent3fe7c645ed11d57cc5f7e1da588fb43cfe1affa3 (diff)
downloadscummvm-rg350-9f00880aa40abb7584a007e10591ee5aa593ae7a.tar.gz
scummvm-rg350-9f00880aa40abb7584a007e10591ee5aa593ae7a.tar.bz2
scummvm-rg350-9f00880aa40abb7584a007e10591ee5aa593ae7a.zip
ZVISION: Properly handle sounds reusing the same sound slot (bug #6761)
This is based on Marisa-Chan's observations in commit 28e27ea1d9. Tested with both ZNEM and ZGI
-rw-r--r--engines/zvision/scripting/actions.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index 3aab6d8830..ce6bd31ee4 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -486,6 +486,11 @@ ActionMusic::~ActionMusic() {
}
bool ActionMusic::execute() {
+ if (_engine->getScriptManager()->getSideFX(_slotKey)) {
+ _engine->getScriptManager()->killSideFx(_slotKey);
+ _engine->getScriptManager()->setStateValue(_slotKey, 2);
+ }
+
if (_midi) {
_engine->getScriptManager()->addSideFX(new MusicMidiNode(_engine, _slotKey, _prog, _note, _volume));
} else {