diff --git a/engine/client/cl_parse_48.c b/engine/client/cl_parse_48.c index 8994312d..ed8a2d7d 100644 --- a/engine/client/cl_parse_48.c +++ b/engine/client/cl_parse_48.c @@ -373,6 +373,8 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message ) old_background = cl.background; if( MSG_ReadOneBit( msg )) { + int old_maxplayers = cl.maxclients; + cls.changelevel = true; S_StopAllSounds( true ); @@ -385,6 +387,13 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message ) } CL_ClearState (); + + // a1ba: need to restore cl.maxclients because engine chooses + // frame backups count depending on this value + // In general, it's incorrect to call CL_InitEdicts right after + // CL_ClearState because of this bug. Some time later this logic + // should be re-done. + cl.maxclients = old_maxplayers; CL_InitEdicts (); // re-arrange edicts } else Con_Printf( "Server disconnected, reconnecting\n" );