mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
Add a sanity check to prevent a potential crash
This commit is contained in:
parent
313008eb19
commit
da9ba25067
1 changed files with 6 additions and 1 deletions
|
@ -308,6 +308,11 @@ visible(edict_t *self, edict_t *other)
|
|||
vec3_t spot2;
|
||||
trace_t trace;
|
||||
|
||||
if (!self || !other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VectorCopy(self->s.origin, spot1);
|
||||
spot1[2] += self->viewheight;
|
||||
VectorCopy(other->s.origin, spot2);
|
||||
|
@ -333,7 +338,7 @@ infront(edict_t *self, edict_t *other)
|
|||
float dot;
|
||||
vec3_t forward;
|
||||
|
||||
if ((self == NULL) || (other == NULL))
|
||||
if (!self || !other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue