aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-26 06:38:52 +0000
committerTorbjörn Andersson2005-05-26 06:38:52 +0000
commitf3f58ec9ebbb91f2e1ccf5a21d7190972cd0cead (patch)
tree00ee67ff993910866011b7b10d7e44337a698729 /scumm
parent12fcf37fee2f03489632dde92eb70f7124689e81 (diff)
downloadscummvm-rg350-f3f58ec9ebbb91f2e1ccf5a21d7190972cd0cead.tar.gz
scummvm-rg350-f3f58ec9ebbb91f2e1ccf5a21d7190972cd0cead.tar.bz2
scummvm-rg350-f3f58ec9ebbb91f2e1ccf5a21d7190972cd0cead.zip
Fixed a glitch that could cause the music to stop when Sam & Max were
thrown out of Bumpusville. svn-id: r18254
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 23023de4d1..4ab69912b1 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -211,16 +211,21 @@ bool IMuseInternal::startSound(int sound) {
Player *player;
void *ptr;
- // Do not start a sound if it is already set to
- // start on an ImTrigger event. This fixes carnival
- // music problems where a sound has been set to trigger
- // at the right time, but then is started up immediately
- // anyway, only to be restarted later when the trigger
- // occurs.
+ // Do not start a sound if it is already set to start on an ImTrigger
+ // event. This fixes carnival music problems where a sound has been set
+ // to trigger at the right time, but then is started up immediately
+ // anyway, only to be restarted later when the trigger occurs.
+ //
+ // However, we have to make sure the sound with the trigger is actually
+ // playing, otherwise the music may stop when Sam and Max are thrown
+ // out of Bumpusville, because entering the mansion sets up a trigger
+ // for a sound that isn't necessarily playing. This is somewhat related
+ // to bug #780918.
+
int i;
ImTrigger *trigger = _snm_triggers;
for (i = ARRAYSIZE(_snm_triggers); i; --i, ++trigger) {
- if (trigger->sound && trigger->id && trigger->command[0] == 8 && trigger->command[1] == sound)
+ if (trigger->sound && trigger->id && trigger->command[0] == 8 && trigger->command[1] == sound && getSoundStatus(trigger->sound))
return false;
}