From 7192bbf3972762183e06ecb853eda8a29b16b7aa Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Wed, 18 Sep 2024 10:40:36 +0800 Subject: [PATCH] Fix 0.7 client flag sounds being duplicated when dummy is connected Closed https://github.com/ddnet-insta/ddnet-insta/issues/127 --- src/game/client/sixup_translate_game.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game/client/sixup_translate_game.cpp b/src/game/client/sixup_translate_game.cpp index f83f1604d..81eb30892 100644 --- a/src/game/client/sixup_translate_game.cpp +++ b/src/game/client/sixup_translate_game.cpp @@ -620,10 +620,12 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn) switch(GameMsgId) { case protocol7::GAMEMSG_CTF_DROP: - m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_DROP); + if(Conn == g_Config.m_ClDummy) + m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_DROP); break; case protocol7::GAMEMSG_CTF_RETURN: - m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_RETURN); + if(Conn == g_Config.m_ClDummy) + m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_RETURN); break; case protocol7::GAMEMSG_TEAM_ALL: { @@ -650,7 +652,8 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn) } break; case protocol7::GAMEMSG_CTF_GRAB: - m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_GRAB_EN); + if(Conn == g_Config.m_ClDummy) + m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_GRAB_EN); break; case protocol7::GAMEMSG_GAME_PAUSED: { @@ -660,7 +663,8 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn) } break; case protocol7::GAMEMSG_CTF_CAPTURE: - m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_CAPTURE); + if(Conn == g_Config.m_ClDummy) + m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_CAPTURE); int ClientId = clamp(aParaI[1], 0, MAX_CLIENTS - 1); m_aStats[ClientId].m_FlagCaptures++;