From c2b55a09c7f76a170239bfdf34c3c4bc380dbb50 Mon Sep 17 00:00:00 2001 From: qkolj Date: Fri, 26 Oct 2018 02:07:16 +0200 Subject: [PATCH] Pause all other sounds during a cutscene (#649) * Pause all other sounds during a cutscene * Modify if statement so it's more understandable --- rwengine/src/engine/GameWorld.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rwengine/src/engine/GameWorld.cpp b/rwengine/src/engine/GameWorld.cpp index cfaeec65..3788bd01 100644 --- a/rwengine/src/engine/GameWorld.cpp +++ b/rwengine/src/engine/GameWorld.cpp @@ -782,6 +782,7 @@ void GameWorld::startCutscene() { state->skipCutscene = false; if (cutsceneAudio.length() > 0) { + sound.pauseAllSounds(); sound.playMusic(cutsceneAudio); } } @@ -794,6 +795,7 @@ void GameWorld::clearCutscene() { if (cutsceneAudio.length() > 0) { sound.stopMusic(cutsceneAudio); cutsceneAudio = ""; + sound.resumeAllSounds(); } delete state->currentCutscene; @@ -881,7 +883,12 @@ void GameWorld::clearTickData() { void GameWorld::setPaused(bool pause) { paused = pause; - sound.pause(pause); + bool resumingCutscene = !pause && !isCutsceneDone(); + if (resumingCutscene) { + sound.playMusic(cutsceneAudio); + } else { + sound.pause(pause); + } } bool GameWorld::isPaused() const {