- fixed some potential NULL pointer accesses.

SVN r3285 (trunk)
This commit is contained in:
Christoph Oelckers 2011-08-30 15:34:40 +00:00
parent eafb9da2c1
commit f2a457206c
3 changed files with 3 additions and 3 deletions

View file

@ -120,10 +120,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
// Boss cubes should move freely to their destination so it's // Boss cubes should move freely to their destination so it's
// probably best to disable all collision detection for them. // probably best to disable all collision detection for them.
if (spit->flags & MF_NOCLIP) spit->flags5 |= MF5_NOINTERACTION;
if (spit != NULL) if (spit != NULL)
{ {
if (spit->flags & MF_NOCLIP) spit->flags5 |= MF5_NOINTERACTION;
spit->target = targ; spit->target = targ;
spit->master = self; spit->master = self;
// [RH] Do this correctly for any trajectory. Doom would divide by 0 // [RH] Do this correctly for any trajectory. Doom would divide by 0

View file

@ -586,7 +586,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
damage += (pr_bfgspray() & 7) + 1; damage += (pr_bfgspray() & 7) + 1;
thingToHit = linetarget; thingToHit = linetarget;
P_DamageMobj (thingToHit, self->target, self->target, damage, spray->DamageType); P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash));
P_TraceBleed (damage, thingToHit, self->target); P_TraceBleed (damage, thingToHit, self->target);
} }
} }

View file

@ -61,9 +61,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
for(i = (pr_pottery()&3)+3; i; i--) for(i = (pr_pottery()&3)+3; i; i--)
{ {
mo = Spawn ("PotteryBit", self->x, self->y, self->z, ALLOW_REPLACE); mo = Spawn ("PotteryBit", self->x, self->y, self->z, ALLOW_REPLACE);
mo->SetState (mo->SpawnState + (pr_pottery()%5));
if (mo) if (mo)
{ {
mo->SetState (mo->SpawnState + (pr_pottery()%5));
mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4); mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4);
mo->velx = (pr_pottery.Random2())<<(FRACBITS-6); mo->velx = (pr_pottery.Random2())<<(FRACBITS-6);
mo->vely = (pr_pottery.Random2())<<(FRACBITS-6); mo->vely = (pr_pottery.Random2())<<(FRACBITS-6);