From fdc2ed809311d441c651599886980eba36f25301 Mon Sep 17 00:00:00 2001 From: xiaodo <1079114958@qq.com> Date: Sat, 15 Feb 2025 01:19:35 +0800 Subject: [PATCH] engine: server: pfnClientCommand and pfnQueryClientCvarValue should execute on unspawned player --- engine/server/sv_game.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 99a903b2..1cd9d2da 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -2379,7 +2379,7 @@ void GAME_EXPORT pfnClientCommand( edict_t* pEdict, char* szFmt, ... ) if( sv.state != ss_active ) return; // early out - if(( cl = SV_ClientFromEdict( pEdict, true )) == NULL ) + if(( cl = SV_ClientFromEdict( pEdict, false )) == NULL ) { Con_Printf( S_ERROR "stuffcmd: client is not spawned!\n" ); return; @@ -4600,7 +4600,7 @@ static void GAME_EXPORT pfnQueryClientCvarValue( const edict_t *player, const ch if( !COM_CheckString( cvarName )) return; - if(( cl = SV_ClientFromEdict( player, true )) != NULL ) + if(( cl = SV_ClientFromEdict( player, false )) != NULL ) { MSG_BeginServerCmd( &cl->netchan.message, svc_querycvarvalue ); MSG_WriteString( &cl->netchan.message, cvarName ); @@ -4627,7 +4627,7 @@ static void GAME_EXPORT pfnQueryClientCvarValue2( const edict_t *player, const c if( !COM_CheckString( cvarName )) return; - if(( cl = SV_ClientFromEdict( player, true )) != NULL ) + if(( cl = SV_ClientFromEdict( player, false )) != NULL ) { MSG_BeginServerCmd( &cl->netchan.message, svc_querycvarvalue2 ); MSG_WriteLong( &cl->netchan.message, requestID );