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 13a7258453
commit eec6f17dff
1 changed files with 9 additions and 1 deletions

View File

@ -293,8 +293,16 @@ qboolean infront (edict_t *self, edict_t *other)
vec3_t vec;
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);