Engine: don't broadcast voice data on training dedi

Training dedi doesn't support broadcasting voice data, return out.
This commit is contained in:
Kawe Mazidjatari 2024-04-20 01:00:49 +02:00
parent 85b7f84d47
commit 84daa21cfd

View File

@ -164,6 +164,9 @@ bool SV_ActivateServer()
void SV_BroadcastVoiceData(CClient* const cl, const int nBytes, char* const data) void SV_BroadcastVoiceData(CClient* const cl, const int nBytes, char* const data)
{ {
if (IsTrainingDedi())
return;
if (!sv_voiceenable->GetBool()) if (!sv_voiceenable->GetBool())
return; return;
@ -174,7 +177,7 @@ void SV_BroadcastVoiceData(CClient* const cl, const int nBytes, char* const data
for (int i = 0; i < g_ServerGlobalVariables->m_nMaxClients; i++) for (int i = 0; i < g_ServerGlobalVariables->m_nMaxClients; i++)
{ {
CClient* pClient = g_pServer->GetClient(i); CClient* const pClient = g_pServer->GetClient(i);
if (!pClient) if (!pClient)
continue; continue;
@ -194,7 +197,7 @@ void SV_BroadcastVoiceData(CClient* const cl, const int nBytes, char* const data
// there's also supposed to be some xplat checks here // there's also supposed to be some xplat checks here
// but since r5r is only on PC, there's no point in implementing them here // but since r5r is only on PC, there's no point in implementing them here
CNetChan* pNetChan = pClient->GetNetChan(); CNetChan* const pNetChan = pClient->GetNetChan();
if (!pNetChan) if (!pNetChan)
continue; continue;