From 8b7ec1103440ebc4cb31ac3e664c480340721437 Mon Sep 17 00:00:00 2001 From: serge_shubin Date: Mon, 23 Mar 2026 05:50:15 +0800 Subject: [PATCH] Fix server command replay: broadcast instead of targeting slot 63 spectatorClientNum was hardcoded to MAX_CLIENTS-1 (63) but the spectator actually connects at the first free slot after zombie reservations. Broadcasting with SV_SendServerCommand(NULL, ...) reaches the spectator regardless of their actual slot number. Zombie clients (< CS_PRIMED) are skipped by the broadcast loop. Co-Authored-By: Claude Opus 4.6 (1M context) --- code/server/sv_netdemo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/server/sv_netdemo.c b/code/server/sv_netdemo.c index f7ac353..bb2b6de 100644 --- a/code/server/sv_netdemo.c +++ b/code/server/sv_netdemo.c @@ -811,11 +811,8 @@ static qboolean SVD_ReadFrame( fileHandle_t f ) { if ( len > 0 && len < (short)sizeof(buf) ) { FS_Read( buf, len, f ); buf[len - 1] = '\0'; - // send to the spectator client - if ( demo.spectatorClientNum < sv_maxclients->integer - && svs.clients[demo.spectatorClientNum].state >= CS_PRIMED ) { - SV_SendServerCommand( &svs.clients[demo.spectatorClientNum], "%s", buf ); - } + // broadcast — only the spectator is CS_ACTIVE, zombies are skipped + SV_SendServerCommand( NULL, "%s", buf ); } } }