Make sure clients don't see random messages before they're actually on server. They can get confused about 666/999/maxclients/etc.

This commit is contained in:
Shpoike 2023-03-18 11:17:12 +00:00
parent 6ffc737f57
commit 3e8e43a388

View file

@ -1944,6 +1944,7 @@ void SV_SendServerinfo (client_t *client)
} }
} }
client->pextknown = true; //if its not set yet, it'll probably never get set.
cantruncate = client->message.cursize == 0; cantruncate = client->message.cursize == 0;
retry: retry:
MSG_WriteByte (&client->message, svc_print); MSG_WriteByte (&client->message, svc_print);
@ -3014,7 +3015,7 @@ void SV_UpdateToReliableMessages (void)
for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++) for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++)
{ {
if (!client->active) if (!client->active || !client->pextknown) //don't let it see random reliables before it sees the svc_serverdata packet.
continue; continue;
SZ_Write (&client->message, sv.reliable_datagram.data, sv.reliable_datagram.cursize); SZ_Write (&client->message, sv.reliable_datagram.data, sv.reliable_datagram.cursize);
} }