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) <noreply@anthropic.com>
This commit is contained in:
parent
0d1f1d515e
commit
8b7ec11034
1 changed files with 2 additions and 5 deletions
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue