Skip to content

Commit

Permalink
Don't spawn loading clients during map restart
Browse files Browse the repository at this point in the history
Don't call SV_ClientEnterWorld during map restart for clients that have't spawned yet. Fixes map failing to load if a map restart occurs during a UDP download (due to CS_ACTIVE check in SV_DoneDownload_f). Also prevents players from spawning prematurely if a map restart occurs while they are loading the map.
  • Loading branch information
Chomenor committed May 24, 2024
1 parent 2baff41 commit b2c1bcb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions code/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,8 @@ static void SV_MapRestart_f( void ) {
continue;
}

if ( client->state == CS_ACTIVE )
if ( client->state == CS_ACTIVE ) {
SV_ClientEnterWorld( client, &client->lastUsercmd );
else {
// If we don't reset client->lastUsercmd and are restarting during map load,
// the client will hang because we'll use the last Usercmd from the previous map,
// which is wrong obviously.
SV_ClientEnterWorld( client, NULL );
}
}

Expand Down

0 comments on commit b2c1bcb

Please sign in to comment.