From 2f10c8ec55e5e8f43f6932199ec3bc402e0ec139 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sat, 26 Apr 2014 15:06:23 +0300
Subject: FULLPIPE: Proper implementation of FullpipeEngine::playSound()

---
 engines/fullpipe/sound.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index d0f8fbd21b..628d352e54 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -266,13 +266,20 @@ void FullpipeEngine::toggleMute() {
 }
 
 void FullpipeEngine::playSound(int id, int flag) {
-	SoundList *soundList = _currentScene->_soundList;
-	Sound *sound = soundList->getSoundById(id);
+	Sound *sound = 0;
+
+	for (int i = 0; i < _currSoundListCount; i++) {
+		sound = _currSoundList1[i]->getSoundById(id);
+
+		if (sound)
+			break;
+	}
 
 	if (!sound) {
 		warning("playSound: Can't find sound with ID %d", id);
 		return;
 	}
+
 	byte *soundData = sound->loadData();
 	Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, sound->getDataSize());
 	Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES);
-- 
cgit v1.2.3