diff --git a/code/game/g_main.c b/code/game/g_main.c index a837e2c..a468854 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -1737,6 +1737,8 @@ int start, end; // demo playback: sync recorded player states and process spectator if ( g_svDemoPlaying.integer ) { + gentity_t *specEnt = NULL; + // mark recorded players as connected based on their playerState. // the server injected playerStates via SV_GameClientNum before // calling G_RunFrame, so g_clients[i].ps is already populated. @@ -1744,10 +1746,11 @@ int start, end; gclient_t *cl = &level.clients[i]; gentity_t *e = &g_entities[i]; - // skip the spectator slot — it's managed normally + // find and process the spectator if ( e->client && cl->pers.connected == CON_CONNECTED && cl->sess.sessionTeam == TEAM_SPECTATOR ) { ClientThink_real( e ); + specEnt = e; continue; } @@ -1766,6 +1769,14 @@ int start, end; e->inuse = qfalse; } } + + // update rankings so follow mode can cycle through players + CalculateRanks(); + + // run end-of-frame for spectator (handles follow mode PS copy) + if ( specEnt ) { + ClientEndFrame( specEnt ); + } return; }