about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2012-04-20 01:50:16 +0200
committeroy <Tom_Adams@web.de>2013-02-24 17:32:29 +0100
commit4d36c0f77e03475b4057f2de3383105283653230 (patch)
treeaaf49b0b594a577c2b40b4523063c119c282fa79
parent0e40ab434a2416b685027f401251b28b0e935efc (diff)
downloadzcatch-4d36c0f77e03475b4057f2de3383105283653230.tar.gz
zcatch-4d36c0f77e03475b4057f2de3383105283653230.zip
prevent that you can play the music ingame. Closes #947
-rw-r--r--src/game/client/components/menus_settings.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index 553195b1..13993783 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -781,10 +781,13 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
 	if(DoButton_CheckBox(&g_Config.m_SndMusic, Localize("Play background music"), g_Config.m_SndMusic, &Button))
 	{
 		g_Config.m_SndMusic ^= 1;
-		if(g_Config.m_SndMusic)
-			m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f);
-		else
-			m_pClient->m_pSounds->Stop(SOUND_MENU);
+		if(Client()->State() == IClient::STATE_OFFLINE)
+		{
+			if(g_Config.m_SndMusic)
+				m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f);
+			else
+				m_pClient->m_pSounds->Stop(SOUND_MENU);
+		}
 	}
 
 	MainView.HSplitTop(20.0f, &Button, &MainView);