mirror of https://github.com/yquake2/xatrix.git
Behebt einen potentiellen Nullpointer beim Herausfinden, ob der Spieler
vor einem Monster steht.
This commit is contained in:
parent
13a7258453
commit
eec6f17dff
10
src/g_ai.c
10
src/g_ai.c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue