Another null pointer check after a damagemobj call.

I'm starting to think people just keep coding zero-tic death states on purpose.
This commit is contained in:
Mari the Deer 2021-10-06 19:02:27 +02:00
commit 46eb3e6282
2 changed files with 3 additions and 3 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.16 \cu(Wed 6 Oct 00:27:03 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.16 \cu(2021-10-06 00:27:03)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.17 \cu(Wed 6 Oct 19:02:58 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.17 \cu(2021-10-06 19:02:58)\c-";

View file

@ -1539,7 +1539,7 @@ Class LampMoth : Actor
Vector3 awaydir = level.Vec3Diff(target.Vec3Offset(0,0,target.height),pos).unit();
vel += awaydir*8.;
int dmg = target.DamageMobj(self,master?master:Actor(self),GetMissileDamage(0,0),'Melee',Random[Moth](0,8)?DMG_NO_PAIN:0);
if ( !target.bNOBLOOD && !target.bDORMANT && !target.bINVULNERABLE )
if ( target && !target.bNOBLOOD && !target.bDORMANT && !target.bINVULNERABLE )
{
target.TraceBleed(dmg,self);
target.SpawnBlood(pos,atan2(awaydir.y,awaydir.x)+180,dmg);