From 534ecfbdff12341ca7d6028671444878fbc0416a Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Mon, 12 Aug 2013 23:03:01 +0200 Subject: [PATCH] added null ptr checkes --- code/game/g_missile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/g_missile.c b/code/game/g_missile.c index bd8def5..af717f1 100644 --- a/code/game/g_missile.c +++ b/code/game/g_missile.c @@ -207,7 +207,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) { other = &g_entities[trace->entityNum]; // check for bounce - if ( !other->takedamage && + if ( other != NULL && + !other->takedamage && (ent->s.eFlags & ( EF_BOUNCE | EF_BOUNCE_HALF )) ) { // Check to see if there is a bounce count @@ -233,7 +234,9 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) { if ( ( ent->s.eFlags & EF_MISSILE_STICK ) ) { // kinda cheap, but if a sticky grenade hits a forcefield or a moving, explode - if ( (other != NULL) && ( ((other->classname != NULL) && !Q_stricmp(other->classname, "holdable_shield")) || (VectorCompare( vec3_origin, other->s.pos.trDelta == 0) && (other->s.pos.trType != TR_STATIONARY)) || ((VectorCompare( vec3_origin, other->s.apos.trDelta ) == 0) && (other->s.apos.trType != TR_STATIONARY)))) + if ( (other != NULL) && (((other->classname != NULL) && !Q_stricmp(other->classname, "holdable_shield")) || + ((other != NULL) && (VectorCompare( vec3_origin, other->s.pos.trDelta) == 0) && (other->s.pos.trType != TR_STATIONARY)) || + ((other != NULL) && (VectorCompare( vec3_origin, other->s.apos.trDelta ) == 0) && (other->s.apos.trType != TR_STATIONARY)))) { //RPG-X: - Our forcefield killer :D if(other && ((other->classname && !Q_stricmp(other->classname, "holdable_shield")))){