From 84daa21cfd9165e04759abc1a604caa588293af8 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:00:49 +0200 Subject: [PATCH] Engine: don't broadcast voice data on training dedi Training dedi doesn't support broadcasting voice data, return out. --- src/engine/server/sv_main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/server/sv_main.cpp b/src/engine/server/sv_main.cpp index 9ad96112..c402ab0b 100644 --- a/src/engine/server/sv_main.cpp +++ b/src/engine/server/sv_main.cpp @@ -164,6 +164,9 @@ bool SV_ActivateServer() void SV_BroadcastVoiceData(CClient* const cl, const int nBytes, char* const data) { + if (IsTrainingDedi()) + return; + if (!sv_voiceenable->GetBool()) 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++) { - CClient* pClient = g_pServer->GetClient(i); + CClient* const pClient = g_pServer->GetClient(i); if (!pClient) 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 // 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) continue;