mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2423
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:
commit
5a41318cbd
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue