mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-10 06:42:21 +00:00
Behebt einen potentiellen Nullpointer beim Herausfinden, ob der Spieler
vor einem Monster steht.
This commit is contained in:
parent
ae3ae9e72c
commit
08340b71b1
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue