Fix player disconnect handling during demo playback

Clear the game module's playerState when a recorded player
disconnects, so G_RunFrame sees commandTime=0 and marks them
as CON_DISCONNECTED. Without this, disconnected players stayed
visible on the scoreboard indefinitely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
serge_shubin 2026-03-23 04:48:35 +08:00
parent 1f8c8aea1c
commit 1a186eeb81

View file

@ -631,6 +631,11 @@ static qboolean SVD_ReadFrame( fileHandle_t f ) {
}
} else {
demo.playPrevPlayers[clientNum].active = qfalse;
// clear game playerState so G_RunFrame sees commandTime=0
if ( clientNum != demo.spectatorClientNum ) {
playerState_t *gamePs = SV_GameClientNum( clientNum );
Com_Memset( gamePs, 0, sizeof(*gamePs) );
}
}
}
}