mirror of
https://github.com/yquake2/xatrix.git
synced 2024-11-10 06:42:22 +00:00
Add some missing sanity checks.
This was reported by Maraakate in yquake2 issue #164.
This commit is contained in:
parent
d3f299cca6
commit
d98e1b9eb0
2 changed files with 10 additions and 0 deletions
|
@ -66,6 +66,11 @@ fire_hit(edict_t *self, vec3_t aim, int damage, int kick)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!self->enemy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* see if enemy is in range */
|
||||
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
|
||||
range = VectorLength(dir);
|
||||
|
|
|
@ -469,6 +469,11 @@ gekk_swim(edict_t *self)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!self->enemy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self->enemy->waterlevel && (random() > 0.7))
|
||||
{
|
||||
water_to_land(self);
|
||||
|
|
Loading…
Reference in a new issue