2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-04-04 16:49:04 +03:00

Add check for NULL edict.

This commit is contained in:
Lev 2017-03-21 01:14:27 +05:00
parent c4d0210615
commit 45a84ead82

View File

@ -520,11 +520,14 @@ void SV_DropClient_internal(client_t *cl, qboolean crash, const char *string)
cl->proxy = FALSE;
COM_ClearCustomizationList(&cl->customdata, FALSE);
#ifdef REHLDS_FIXES
// Reset flags, leave FL_DORMANT used by CS
cl->edict->v.flags &= FL_DORMANT;
// Since the edict doesn't get deleted, fix it so it doesn't interfere.
cl->edict->v.takedamage = DAMAGE_NO; // don't attract autoaim
cl->edict->v.solid = SOLID_NOT;
if (cl->edict)
{
// Reset flags, leave FL_DORMANT used by CS
cl->edict->v.flags &= FL_DORMANT;
// Since the edict doesn't get deleted, fix it so it doesn't interfere.
cl->edict->v.takedamage = DAMAGE_NO; // don't attract autoaim
cl->edict->v.solid = SOLID_NOT;
}
#endif // REHLDS_FIXES
cl->edict = NULL;
Q_memset(cl->userinfo, 0, sizeof(cl->userinfo));