Add a sanity check to prevent a potential crash

This commit is contained in:
Yamagi Burmeister 2011-09-27 16:08:55 +00:00
parent 313008eb19
commit da9ba25067

View file

@ -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;
}