From 1f4c9b67da3e3d6576f029da72d5015fb29348ff Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 13 Feb 2024 15:09:22 +0300 Subject: [PATCH] engine: server: don't init or send voice chat in singleplayer --- engine/server/sv_client.c | 2 +- engine/server/sv_init.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index dd868a88..23ee0e24 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -3458,7 +3458,7 @@ static void SV_ParseVoiceData( sv_client_t *cl, sizebuf_t *msg ) MSG_ReadBytes( msg, received, size ); - if( !sv_voiceenable.value ) + if( !sv_voiceenable.value || svs.maxclients <= 1 ) return; for( i = 0, cur = svs.clients; i < svs.maxclients; i++, cur++ ) diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index 341aecca..bf0ba63f 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -469,7 +469,8 @@ static void SV_CreateBaseline( void ) int delta_type; int entnum; - SV_WriteVoiceCodec( &sv.signon ); + if( svs.maxclients > 1 ) + SV_WriteVoiceCodec( &sv.signon ); if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE )) playermodel = SV_ModelIndex( DEFAULT_PLAYER_PATH_QUAKE );