diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index 5988519..4a2d54c 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -1498,7 +1498,7 @@ void SV_New_f(void) return; } - if (!host_client->active && host_client->spawned) + if ((host_client->hasusrmsgs && host_client->m_bSentNewResponse) || (!host_client->active && host_client->spawned)) { return; } @@ -1564,6 +1564,7 @@ void SV_New_f(void) } Netchan_CreateFragments(TRUE, &host_client->netchan, &msg); Netchan_FragSend(&host_client->netchan); + host_client->m_bSentNewResponse = TRUE; } void SV_SendRes_f(void) @@ -7371,6 +7372,8 @@ void SV_InactivateClients(void) cl->connected = TRUE; cl->spawned = FALSE; cl->fully_connected = FALSE; + cl->hasusrmsgs = FALSE; + cl->m_bSentNewResponse = FALSE; SZ_Clear(&cl->netchan.message); SZ_Clear(&cl->datagram); diff --git a/rehlds/engine/sv_user.cpp b/rehlds/engine/sv_user.cpp index 16a48c4..7abd811 100644 --- a/rehlds/engine/sv_user.cpp +++ b/rehlds/engine/sv_user.cpp @@ -1779,6 +1779,12 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) { return; } +#ifdef REHLDS_FIXES + // Save current name of the client before a possible kick + char name[32]; + Q_strlcpy(name, host_client->name); +#endif + void(*func)(client_t *) = sv_clcfuncs[opcode].pfnParse; if (func) func(cl); @@ -1786,7 +1792,7 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) { #ifdef REHLDS_FIXES if (msg_badread) { - Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", host_client->name, sv_clcfuncs[opcode].pszname); + Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", name, sv_clcfuncs[opcode].pszname); } #endif