From 52cc84374dfa49d63f9f5761e4a2b0b614144888 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 7 May 2020 11:49:31 -0400 Subject: [PATCH] CScriptStreamedMusic: Brace conditionals where applicable --- Runtime/World/CScriptStreamedMusic.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Runtime/World/CScriptStreamedMusic.cpp b/Runtime/World/CScriptStreamedMusic.cpp index 0cf0e9e2e..d98f695cd 100644 --- a/Runtime/World/CScriptStreamedMusic.cpp +++ b/Runtime/World/CScriptStreamedMusic.cpp @@ -52,14 +52,18 @@ CScriptStreamedMusic::CScriptStreamedMusic(TUniqueId id, const CEntityInfo& info , x50_volume(volume) {} void CScriptStreamedMusic::Stop(CStateManager& mgr) { - if (x45_fileIsDsp) - StopStream(mgr); + if (!x45_fileIsDsp) { + return; + } + + StopStream(mgr); } void CScriptStreamedMusic::Play(CStateManager& mgr) { TweakOverride(mgr); - if (x45_fileIsDsp) + if (x45_fileIsDsp) { StartStream(mgr); + } } void CScriptStreamedMusic::Accept(IVisitor& visitor) { visitor.Visit(this); } @@ -68,20 +72,24 @@ void CScriptStreamedMusic::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId o CEntity::AcceptScriptMsg(msg, objId, stateMgr); switch (msg) { case EScriptObjectMessage::Play: - if (x30_24_active) + if (x30_24_active) { Play(stateMgr); + } break; case EScriptObjectMessage::Stop: - if (x30_24_active) + if (x30_24_active) { Stop(stateMgr); + } break; case EScriptObjectMessage::Increment: - if (x45_fileIsDsp) + if (x45_fileIsDsp) { CStreamAudioManager::FadeBackIn(!x46_loop, x48_fadeIn); + } break; case EScriptObjectMessage::Decrement: - if (x45_fileIsDsp) + if (x45_fileIsDsp) { CStreamAudioManager::TemporaryFadeOut(!x46_loop, x4c_fadeOut); + } break; default: break;