Skip to content

Commit

Permalink
Add check for NULL edict.
Browse files Browse the repository at this point in the history
  • Loading branch information
LevShisterov committed Mar 20, 2017
1 parent c4d0210 commit 45a84ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rehlds/engine/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

1 comment on commit 45a84ea

@souvikdas95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could be the possible usecase of this commit?

Please sign in to comment.