about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-07-17 19:55:17 +0200
committeroy <Tom_Adams@web.de>2010-07-17 19:55:17 +0200
commit22c19f45dbb38b234e96279897ee96ec86832701 (patch)
tree69f4a95ec10e80fceda1dea517f43ad61afafec9 /src/game/client
parent6193f354232b3cc9a7272c3b17cfc52b6415c9b8 (diff)
downloadzcatch-22c19f45dbb38b234e96279897ee96ec86832701.tar.gz
zcatch-22c19f45dbb38b234e96279897ee96ec86832701.zip
fixed hook sound bug in demos. Closes #161
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/gameclient.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index d59a7a04..a3f618ab 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -545,9 +545,15 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
 	{
 		if(m_SuppressEvents)
 			return;
-			
+		
+		// don't enqueue pseudo-global sounds from demos (created by PlayAndRecord)
 		CNetMsg_Sv_SoundGlobal *pMsg = (CNetMsg_Sv_SoundGlobal *)pRawMsg;
-		g_GameClient.m_pSounds->Enqueue(pMsg->m_Soundid);
+		if(pMsg->m_Soundid == SOUND_CTF_DROP || pMsg->m_Soundid == SOUND_CTF_RETURN ||
+			pMsg->m_Soundid == SOUND_CTF_CAPTURE || pMsg->m_Soundid == SOUND_CTF_GRAB_EN ||
+			pMsg->m_Soundid == SOUND_CTF_GRAB_PL)
+			g_GameClient.m_pSounds->Enqueue(pMsg->m_Soundid);
+		else
+			g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_Soundid, 1.0f, vec2(0,0));
 	}		
 }