mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-16 17:11:03 +00:00
Add a sanity check to prevent a potential crash
This commit is contained in:
parent
313008eb19
commit
da9ba25067
1 changed files with 6 additions and 1 deletions
|
@ -308,6 +308,11 @@ visible(edict_t *self, edict_t *other)
|
||||||
vec3_t spot2;
|
vec3_t spot2;
|
||||||
trace_t trace;
|
trace_t trace;
|
||||||
|
|
||||||
|
if (!self || !other)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
VectorCopy(self->s.origin, spot1);
|
VectorCopy(self->s.origin, spot1);
|
||||||
spot1[2] += self->viewheight;
|
spot1[2] += self->viewheight;
|
||||||
VectorCopy(other->s.origin, spot2);
|
VectorCopy(other->s.origin, spot2);
|
||||||
|
@ -333,7 +338,7 @@ infront(edict_t *self, edict_t *other)
|
||||||
float dot;
|
float dot;
|
||||||
vec3_t forward;
|
vec3_t forward;
|
||||||
|
|
||||||
if ((self == NULL) || (other == NULL))
|
if (!self || !other)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue