mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-02-24 04:51:12 +00:00
added null ptr checkes
This commit is contained in:
parent
810bf1b644
commit
534ecfbdff
1 changed files with 5 additions and 2 deletions
|
@ -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")))){
|
||||||
|
|
Loading…
Reference in a new issue