2423: Only SendChat to clients that exist. Initialize m_Sixup anyway r=def- a=Learath2

#2421 

Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2020-06-30 16:25:47 +00:00 committed by GitHub
commit 5a41318cbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -484,6 +484,7 @@ int CServer::Init()
m_aClients[i].m_ShowIps = false;
m_aClients[i].m_AuthKey = -1;
m_aClients[i].m_Latency = 0;
m_aClients[i].m_Sixup = false;
}
m_CurrentGameTick = 0;

View file

@ -405,10 +405,12 @@ void CGameContext::SendChat(int ChatterClientID, int Team, const char *pText, in
// send to the clients
for(int i = 0; i < MAX_CLIENTS; i++)
{
if(!m_apPlayers[i])
continue;
bool Send = (Server()->IsSixup(i) && (Flags & CHAT_SIXUP)) ||
(!Server()->IsSixup(i) && (Flags & CHAT_SIX));
if(m_apPlayers[i] != 0 && !m_apPlayers[i]->m_DND && Send)
if(!m_apPlayers[i]->m_DND && Send)
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL|MSGFLAG_NORECORD, i);
}
}