mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Behebt einen potentiellen Nullpointer beim Herausfinden, ob der Spieler
vor einem Monster steht.
This commit is contained in:
parent
f9fbe8d380
commit
54eec20990
2 changed files with 15 additions and 1 deletions
|
@ -315,7 +315,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);
|
||||
|
|
|
@ -314,8 +314,15 @@ 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 a new issue