Small fixups to grenates and rockets

This commit is contained in:
Yamagi Burmeister 2011-08-16 09:54:22 +00:00
parent 76e4017dea
commit c196b662b6
2 changed files with 8 additions and 3 deletions

View file

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// monster weapons
//
//FIXME mosnters should call these with a totally accurate direction
//FIXME monsters should call these with a totally accurate direction
// and we can mess it up based on skill. Spread should be for normal
// and we can tighten or loosen based on skill. We could muck with
// the damages too, but I'm not sure that's such a good idea.

View file

@ -69,6 +69,10 @@ qboolean fire_hit (edict_t *self, vec3_t aim, int damage, int kick)
float range;
vec3_t dir;
// Lazarus: Paranoia check
if(!self->enemy)
return false;
//see if enemy is in range
VectorSubtract (self->enemy->s.origin, self->s.origin, dir);
range = VectorLength(dir);
@ -364,6 +368,7 @@ void fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int spee
bolt->clipmask = MASK_SHOT;
bolt->solid = SOLID_BBOX;
bolt->s.effects |= effect;
bolt->s.renderfx |= RF_NOSHADOW;
VectorClear (bolt->mins);
VectorClear (bolt->maxs);
bolt->s.modelindex = gi.modelindex ("models/objects/laser/tris.md2");
@ -400,7 +405,7 @@ static void Grenade_Explode (edict_t *ent)
vec3_t origin;
int mod;
if (ent->owner->client)
if (ent->owner && ent->owner->client)
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);
//FIXME: if we are onground then raise our Z just a bit since we are a point?
@ -580,7 +585,7 @@ void rocket_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *su
return;
}
if (ent->owner->client)
if (ent->owner && ent->owner->client)
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);
// calculate position for the explosion entity