Behebt einen potentiellen Nullpointer beim Herausfinden, ob der Spieler

vor einem Monster steht.
This commit is contained in:
Yamagi Burmeister 2011-01-23 14:40:50 +00:00
parent ae3ae9e72c
commit 08340b71b1

View file

@ -368,7 +368,14 @@ qboolean infront (edict_t *self, edict_t *other)
float dot;
vec3_t forward;
if ((self == NULL) || (other == NULL))
return false;
AngleVectors (self->s.angles, forward, NULL, NULL);
if ((self == NULL) || (other == NULL))
return false;
VectorSubtract (other->s.origin, self->s.origin, vec);
VectorNormalize (vec);
dot = DotProduct (vec, forward);