added null ptr checkes

This commit is contained in:
Walter Julius Hennecke 2013-08-12 23:03:01 +02:00
parent 810bf1b644
commit 534ecfbdff

View file

@ -207,7 +207,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
other = &g_entities[trace->entityNum]; other = &g_entities[trace->entityNum];
// check for bounce // check for bounce
if ( !other->takedamage && if ( other != NULL &&
!other->takedamage &&
(ent->s.eFlags & ( EF_BOUNCE | EF_BOUNCE_HALF )) ) (ent->s.eFlags & ( EF_BOUNCE | EF_BOUNCE_HALF )) )
{ {
// Check to see if there is a bounce count // 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 ) ) if ( ( ent->s.eFlags & EF_MISSILE_STICK ) )
{ {
// kinda cheap, but if a sticky grenade hits a forcefield or a moving, explode // 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 //RPG-X: - Our forcefield killer :D
if(other && ((other->classname && !Q_stricmp(other->classname, "holdable_shield")))){ if(other && ((other->classname && !Q_stricmp(other->classname, "holdable_shield")))){