Merge pull request #7452 from Robyt3/Server-Max-Clients-Crash

Fix server crash on DDTeam message with lower `sv_max_clients`
This commit is contained in:
heinrich5991 2023-11-13 22:46:06 +00:00 committed by GitHub
commit 90fb33ae43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -522,7 +522,7 @@ void CGameContext::SendChatTarget(int To, const char *pText, int Flags)
void CGameContext::SendChatTeam(int Team, const char *pText)
{
for(int i = 0; i < MAX_CLIENTS; i++)
if(((CGameControllerDDRace *)m_pController)->m_Teams.m_Core.Team(i) == Team)
if(m_apPlayers[i] != nullptr && ((CGameControllerDDRace *)m_pController)->m_Teams.m_Core.Team(i) == Team)
SendChatTarget(i, pText);
}