From 9450a9e72d29573c9505ae0e3265c7e21f672b0f Mon Sep 17 00:00:00 2001 From: Henri Derycke Date: Sun, 25 Nov 2018 15:48:22 +0100 Subject: [PATCH] misplace silent mode --- src/game/server/gamecontext.cpp | 6 ++++++ src/game/server/gamecontroller.cpp | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 9bb4ef500..407be5f94 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -601,6 +601,10 @@ void CGameContext::OnClientEnter(int ClientID) NewClientInfoMsg.m_pClan = Server()->ClientClan(ClientID); NewClientInfoMsg.m_Country = Server()->ClientCountry(ClientID); NewClientInfoMsg.m_Silent = false; + + if(g_Config.m_SvSilentSpectatorMode && m_apPlayers[ClientID]->GetTeam() == TEAM_SPECTATORS) + NewClientInfoMsg.m_Silent = true; + for(int p = 0; p < 6; p++) { NewClientInfoMsg.m_apSkinPartNames[p] = m_apPlayers[ClientID]->m_TeeInfos.m_aaSkinPartNames[p]; @@ -690,6 +694,8 @@ void CGameContext::OnClientDrop(int ClientID, const char *pReason) Msg.m_ClientID = ClientID; Msg.m_pReason = pReason; Msg.m_Silent = false; + if(g_Config.m_SvSilentSpectatorMode && m_apPlayers[ClientID]->GetTeam() == TEAM_SPECTATORS) + Msg.m_Silent = true; Server()->SendPackMsg(&Msg, MSGFLAG_VITAL|MSGFLAG_NORECORD, -1); } diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index f87fd2ab6..dffecc7d3 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -1104,8 +1104,6 @@ void IGameController::DoTeamChange(CPlayer *pPlayer, int Team, bool DoChatMsg) Msg.m_ClientID = ClientID; Msg.m_Team = Team; Msg.m_Silent = DoChatMsg ? 0 : 1; - if(g_Config.m_SvSilentSpectatorMode && Team == TEAM_SPECTATORS) - Msg.m_Silent = 1; Msg.m_CooldownTick = pPlayer->m_TeamChangeTick; Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);