Add some missing sanity checks.

This was reported by Maraakate in yquake2 issue #164.
This commit is contained in:
Yamagi Burmeister 2016-12-28 18:04:14 +01:00
parent d3f299cca6
commit d98e1b9eb0
2 changed files with 10 additions and 0 deletions

View file

@ -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);

View file

@ -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);