- reviewd script code for spawn calls that did not check their results.

Nothing should ever assume that spawning an actor is unconditionally successful. There can always be some edge cases where this is not the case.
This commit is contained in:
Christoph Oelckers 2016-12-31 15:40:16 +01:00
parent c845fc126a
commit 3d61d2c1f4
24 changed files with 222 additions and 130 deletions

View file

@ -116,10 +116,13 @@ extend class Actor
A_FaceTarget (); A_FaceTarget ();
Actor fog = Spawn (fire, target.Pos, ALLOW_REPLACE); Actor fog = Spawn (fire, target.Pos, ALLOW_REPLACE);
tracer = fog; if (fog != null)
fog.target = self; {
fog.tracer = self.target; tracer = fog;
fog.A_Fire(0); fog.target = self;
fog.tracer = self.target;
fog.A_Fire(0);
}
} }
} }

View file

@ -188,6 +188,7 @@ extend class Actor
// Now launch mushroom cloud // Now launch mushroom cloud
Actor aimtarget = Spawn("Mapspot", pos, NO_REPLACE); // We need something to aim at. Actor aimtarget = Spawn("Mapspot", pos, NO_REPLACE); // We need something to aim at.
if (aimtarget == null) return;
Actor owner = (flags & MSF_DontHurt) ? target : self; Actor owner = (flags & MSF_DontHurt) ? target : self;
aimtarget.Height = Height; aimtarget.Height = Height;

View file

@ -233,10 +233,13 @@ extend class Actor
SpawnPuff ("BulletPuff", pos, angle, angle, 3); SpawnPuff ("BulletPuff", pos, angle, angle, 3);
Actor smoke = Spawn ("RevenantTracerSmoke", Vec3Offset(-Vel.X, -Vel.Y, 0.), ALLOW_REPLACE); Actor smoke = Spawn ("RevenantTracerSmoke", Vec3Offset(-Vel.X, -Vel.Y, 0.), ALLOW_REPLACE);
smoke.Vel.Z = 1.; if (smoke != null)
smoke.tics -= random[Tracer](0, 3); {
if (smoke.tics < 1) smoke.Vel.Z = 1.;
smoke.tics = 1; smoke.tics -= random[Tracer](0, 3);
if (smoke.tics < 1)
smoke.tics = 1;
}
// The rest of this function was identical with Strife's version, except for the angle being used. // The rest of this function was identical with Strife's version, except for the angle being used.
A_Tracer2(16.875); A_Tracer2(16.875);

View file

@ -335,11 +335,14 @@ extend class Actor
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
Actor mo = Spawn("Feather", pos + (0, 0, 20), NO_REPLACE); Actor mo = Spawn("Feather", pos + (0, 0, 20), NO_REPLACE);
mo.target = self; if (mo != null)
mo.Vel.X = Random2[Feathers]() / 256.; {
mo.Vel.Y = Random2[Feathers]() / 256.; mo.target = self;
mo.Vel.Z = 1. + random[Feathers]() / 128.; mo.Vel.X = Random2[Feathers]() / 256.;
mo.SetState (mo.SpawnState + (random[Feathers]()&7)); mo.Vel.Y = Random2[Feathers]() / 256.;
mo.Vel.Z = 1. + random[Feathers]() / 128.;
mo.SetState (mo.SpawnState + (random[Feathers]()&7));
}
} }
} }

View file

@ -166,13 +166,14 @@ class Sorcerer1 : Actor
{ {
bSolid = false; bSolid = false;
Actor mo = Spawn("Sorcerer2", Pos, ALLOW_REPLACE); Actor mo = Spawn("Sorcerer2", Pos, ALLOW_REPLACE);
mo.Translation = Translation; if (mo != null)
mo.SetStateLabel("Rise"); {
mo.angle = angle; mo.Translation = Translation;
mo.CopyFriendliness (self, true); mo.SetStateLabel("Rise");
mo.angle = angle;
mo.CopyFriendliness (self, true);
}
} }
} }
@ -434,9 +435,12 @@ class Sorcerer2FX1 : Actor
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
Actor mo = Spawn("Sorcerer2FXSpark", pos, ALLOW_REPLACE); Actor mo = Spawn("Sorcerer2FXSpark", pos, ALLOW_REPLACE);
mo.Vel.X = Random2[BlueSpark]() / 128.; if (mo != null)
mo.Vel.Y = Random2[BlueSpark]() / 128.; {
mo.Vel.Z = 1. + Random[BlueSpark]() / 256.; mo.Vel.X = Random2[BlueSpark]() / 128.;
mo.Vel.Y = Random2[BlueSpark]() / 128.;
mo.Vel.Z = 1. + Random[BlueSpark]() / 256.;
}
} }
} }
} }

View file

@ -149,7 +149,7 @@ Class ArtiTimeBomb : Inventory
override bool Use (bool pickup) override bool Use (bool pickup)
{ {
Actor mo = Spawn("ActivatedTimeBomb", Owner.Vec3Angle(24., Owner.angle, - Owner.Floorclip), ALLOW_REPLACE); Actor mo = Spawn("ActivatedTimeBomb", Owner.Vec3Angle(24., Owner.angle, - Owner.Floorclip), ALLOW_REPLACE);
mo.target = Owner; if (mo != null) mo.target = Owner;
return true; return true;
} }

View file

@ -102,14 +102,20 @@ class HereticImp : Actor
bNoGravity = false; bNoGravity = false;
chunk = Spawn("HereticImpChunk1", pos, ALLOW_REPLACE); chunk = Spawn("HereticImpChunk1", pos, ALLOW_REPLACE);
chunk.vel.x = random2[ImpExplode]() / 64.; if (chunk != null)
chunk.vel.y = random2[ImpExplode]() / 64.; {
chunk.vel.z = 9; chunk.vel.x = random2[ImpExplode]() / 64.;
chunk.vel.y = random2[ImpExplode]() / 64.;
chunk.vel.z = 9;
}
chunk = Spawn("HereticImpChunk2", pos, ALLOW_REPLACE); chunk = Spawn("HereticImpChunk2", pos, ALLOW_REPLACE);
chunk.vel.x = random2[ImpExplode]() / 64.; if (chunk != null)
chunk.vel.y = random2[ImpExplode]() / 64.; {
chunk.vel.z = 9; chunk.vel.x = random2[ImpExplode]() / 64.;
chunk.vel.y = random2[ImpExplode]() / 64.;
chunk.vel.z = 9;
}
if (extremecrash) if (extremecrash)
{ {

View file

@ -60,10 +60,13 @@ class Pod : Actor
for (int count = chance > 240 ? 2 : 1; count; count--) for (int count = chance > 240 ? 2 : 1; count; count--)
{ {
Actor goo = Spawn(gootype, pos + (0, 0, 48), ALLOW_REPLACE); Actor goo = Spawn(gootype, pos + (0, 0, 48), ALLOW_REPLACE);
goo.target = self; if (goo != null)
goo.Vel.X = Random2[PodPain]() / 128.; {
goo.Vel.Y = Random2[PodPain]() / 128.; goo.target = self;
goo.Vel.Z = 0.5 + random[PodPain]() / 128.; goo.Vel.X = Random2[PodPain]() / 128.;
goo.Vel.Y = Random2[PodPain]() / 128.;
goo.Vel.Z = 0.5 + random[PodPain]() / 128.;
}
} }
} }
@ -295,12 +298,15 @@ class Volcano : Actor
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
Actor blast = Spawn("VolcanoBlast", pos + (0, 0, 44), ALLOW_REPLACE); Actor blast = Spawn("VolcanoBlast", pos + (0, 0, 44), ALLOW_REPLACE);
blast.target = self; if (blast != null)
blast.Angle = random[VolcanoBlast]() * (360 / 256.); {
blast.VelFromAngle(1.); blast.target = self;
blast.Vel.Z = 2.5 + random[VolcanoBlast]() / 64.; blast.Angle = random[VolcanoBlast]() * (360 / 256.);
blast.A_PlaySound ("world/volcano/shoot", CHAN_BODY); blast.VelFromAngle(1.);
blast.CheckMissileSpawn (radius); blast.Vel.Z = 2.5 + random[VolcanoBlast]() / 64.;
blast.A_PlaySound ("world/volcano/shoot", CHAN_BODY);
blast.CheckMissileSpawn (radius);
}
} }
} }
} }

View file

@ -102,12 +102,15 @@ class Ironlich : Actor
{ {
A_PlaySound ("ironlich/attack1", CHAN_BODY); A_PlaySound ("ironlich/attack1", CHAN_BODY);
} }
fire.target = baseFire.target; if (fire != null)
fire.angle = baseFire.angle; {
fire.Vel = baseFire.Vel; fire.target = baseFire.target;
fire.SetDamage(0); fire.angle = baseFire.angle;
fire.health = (i+1) * 2; fire.Vel = baseFire.Vel;
fire.CheckMissileSpawn (radius); fire.SetDamage(0);
fire.health = (i+1) * 2;
fire.CheckMissileSpawn (radius);
}
} }
} }
} }
@ -167,11 +170,14 @@ class HeadFX1 : Actor
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
Actor shard = Spawn("HeadFX2", Pos, ALLOW_REPLACE); Actor shard = Spawn("HeadFX2", Pos, ALLOW_REPLACE);
shard.target = target; if (shard != null)
shard.angle = i*45.; {
shard.VelFromAngle(); shard.target = target;
shard.Vel.Z = -.6; shard.angle = i*45.;
shard.CheckMissileSpawn (radius); shard.VelFromAngle();
shard.Vel.Z = -.6;
shard.CheckMissileSpawn (radius);
}
} }
} }
} }

View file

@ -163,8 +163,11 @@ class RedAxe : KnightAxe
double xo = random2[DripBlood]() / 32.0; double xo = random2[DripBlood]() / 32.0;
double yo = random2[DripBlood]() / 32.0; double yo = random2[DripBlood]() / 32.0;
Actor mo = Spawn ("Blood", Vec3Offset(xo, yo, 0.), ALLOW_REPLACE); Actor mo = Spawn ("Blood", Vec3Offset(xo, yo, 0.), ALLOW_REPLACE);
mo.Vel.X = random2[DripBlood]() / 64.0; if (mo != null)
mo.Vel.Y = random2[DripBlood]() / 64.0; {
mo.Gravity = 1./8; mo.Vel.X = random2[DripBlood]() / 64.0;
mo.Vel.Y = random2[DripBlood]() / 64.0;
mo.Gravity = 1./8;
}
} }
} }

View file

@ -160,10 +160,13 @@ class BlasterFX1 : FastProjectile
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
{ {
Actor ripper = Spawn("Ripper", pos, ALLOW_REPLACE); Actor ripper = Spawn("Ripper", pos, ALLOW_REPLACE);
ripper.target = target; if (ripper != null)
ripper.angle = i*45; {
ripper.VelFromAngle(); ripper.target = target;
ripper.CheckMissileSpawn (radius); ripper.angle = i*45;
ripper.VelFromAngle();
ripper.CheckMissileSpawn (radius);
}
} }
} }
} }

View file

@ -60,14 +60,17 @@ class Mace : HereticWeapon
if (random[MaceAtk]() < 28) if (random[MaceAtk]() < 28)
{ {
Actor ball = Spawn("MaceFX2", Pos + (0, 0, 28 - Floorclip), ALLOW_REPLACE); Actor ball = Spawn("MaceFX2", Pos + (0, 0, 28 - Floorclip), ALLOW_REPLACE);
ball.Vel.Z = 2 - clamp(tan(pitch), -5, 5); if (ball != null)
ball.target = self; {
ball.angle = self.angle; ball.Vel.Z = 2 - clamp(tan(pitch), -5, 5);
ball.AddZ(ball.Vel.Z); ball.target = self;
ball.VelFromAngle(); ball.angle = self.angle;
ball.Vel += Vel.xy / 2; ball.AddZ(ball.Vel.Z);
ball.A_PlaySound ("weapons/maceshoot", CHAN_BODY); ball.VelFromAngle();
ball.CheckMissileSpawn (radius); ball.Vel += Vel.xy / 2;
ball.A_PlaySound ("weapons/maceshoot", CHAN_BODY);
ball.CheckMissileSpawn (radius);
}
} }
else else
{ {
@ -260,18 +263,24 @@ class MaceFX2 : MaceFX1
SetState (SpawnState); SetState (SpawnState);
Actor tiny = Spawn("MaceFX3", Pos, ALLOW_REPLACE); Actor tiny = Spawn("MaceFX3", Pos, ALLOW_REPLACE);
tiny.target = target; if (tiny != null)
tiny.angle = angle + 90.; {
tiny.VelFromAngle(Vel.Z - 1.); tiny.target = target;
tiny.Vel += (Vel.XY * .5, Vel.Z); tiny.angle = angle + 90.;
tiny.CheckMissileSpawn (radius); tiny.VelFromAngle(Vel.Z - 1.);
tiny.Vel += (Vel.XY * .5, Vel.Z);
tiny.CheckMissileSpawn (radius);
}
tiny = Spawn("MaceFX3", Pos, ALLOW_REPLACE); tiny = Spawn("MaceFX3", Pos, ALLOW_REPLACE);
tiny.target = target; if (tiny != null)
tiny.angle = angle - 90.; {
tiny.VelFromAngle(Vel.Z - 1.); tiny.target = target;
tiny.Vel += (Vel.XY * .5, Vel.Z); tiny.angle = angle - 90.;
tiny.CheckMissileSpawn (radius); tiny.VelFromAngle(Vel.Z - 1.);
tiny.Vel += (Vel.XY * .5, Vel.Z);
tiny.CheckMissileSpawn (radius);
}
return; return;
} }
} }

View file

@ -151,16 +151,19 @@ class PhoenixRodPowered : PhoenixRod
slope += 0.1; slope += 0.1;
Actor mo = Spawn("PhoenixFX2", spawnpos, ALLOW_REPLACE); Actor mo = Spawn("PhoenixFX2", spawnpos, ALLOW_REPLACE);
mo.target = self; if (mo != null)
mo.Angle = Angle; {
mo.VelFromAngle(); mo.target = self;
mo.Vel.XY += Vel.XY; mo.Angle = Angle;
mo.Vel.Z = mo.Speed * slope; mo.VelFromAngle();
mo.Vel.XY += Vel.XY;
mo.Vel.Z = mo.Speed * slope;
mo.CheckMissileSpawn (radius);
}
if (!player.refire) if (!player.refire)
{ {
A_PlaySound("weapons/phoenixpowshoot", CHAN_WEAPON, 1, true); A_PlaySound("weapons/phoenixpowshoot", CHAN_WEAPON, 1, true);
} }
mo.CheckMissileSpawn (radius);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -239,10 +242,16 @@ class PhoenixFX1 : Actor
//[RH] Heretic never sets the target for seeking //[RH] Heretic never sets the target for seeking
//P_SeekerMissile (self, 5, 10); //P_SeekerMissile (self, 5, 10);
Actor puff = Spawn("PhoenixPuff", Pos, ALLOW_REPLACE); Actor puff = Spawn("PhoenixPuff", Pos, ALLOW_REPLACE);
puff.Vel.XY = AngleToVector(Angle + 90, 1.3); if (puff != null)
{
puff.Vel.XY = AngleToVector(Angle + 90, 1.3);
}
puff = Spawn("PhoenixPuff", Pos, ALLOW_REPLACE); puff = Spawn("PhoenixPuff", Pos, ALLOW_REPLACE);
puff.Vel.XY = AngleToVector(Angle - 90, 1.3); if (puff != null)
{
puff.Vel.XY = AngleToVector(Angle - 90, 1.3);
}
} }

View file

@ -70,7 +70,8 @@ extend class Actor
// [RH] Floor and ceiling huggers should not be blasted vertically. // [RH] Floor and ceiling huggers should not be blasted vertically.
if (!victim.bFloorHugger && !victim.bCeilingHugger) if (!victim.bFloorHugger && !victim.bCeilingHugger)
{ {
mo.Vel.Z = victim.Vel.Z = 8; victim.Vel.Z = 8;
if (mo != null) mo.Vel.Z = 8;
} }
} }
else else

View file

@ -567,14 +567,17 @@ class HolyTail : Actor
static void SpawnSpiritTail (Actor spirit) static void SpawnSpiritTail (Actor spirit)
{ {
Actor tail = Spawn ("HolyTail", spirit.Pos, ALLOW_REPLACE); Actor tail = Spawn ("HolyTail", spirit.Pos, ALLOW_REPLACE);
tail.target = spirit; // parent if (tail != null)
for (int i = 1; i < 3; i++)
{ {
Actor next = Spawn ("HolyTailTrail", spirit.Pos, ALLOW_REPLACE); tail.target = spirit; // parent
tail.tracer = next; for (int i = 1; i < 3; i++)
tail = next; {
Actor next = Spawn ("HolyTailTrail", spirit.Pos, ALLOW_REPLACE);
tail.tracer = next;
tail = next;
}
tail.tracer = null; // last tail bit
} }
tail.tracer = null; // last tail bit
} }
//============================================================================ //============================================================================

View file

@ -255,10 +255,13 @@ class ArtiPoisonBag : Inventory
} }
class<Actor> spawntype = GetFlechetteType(other); class<Actor> spawntype = GetFlechetteType(other);
Inventory copy = Inventory(Spawn (spawntype)); let copy = Inventory(Spawn (spawntype));
copy.Amount = Amount; if (copy != null)
copy.MaxAmount = MaxAmount; {
GoAwayAndDie (); copy.Amount = Amount;
copy.MaxAmount = MaxAmount;
GoAwayAndDie ();
}
return copy; return copy;
} }
} }

View file

@ -315,17 +315,20 @@ class Korax : Actor
private void SpawnKoraxMissile (Vector3 pos, Actor dest, Class<Actor> type) private void SpawnKoraxMissile (Vector3 pos, Actor dest, Class<Actor> type)
{ {
Actor th = Spawn (type, pos, ALLOW_REPLACE); Actor th = Spawn (type, pos, ALLOW_REPLACE);
th.target = self; // Originator if (th != null)
double an = th.AngleTo(dest); {
if (dest.bShadow) th.target = self; // Originator
{ // Invisible target double an = th.AngleTo(dest);
an += Random2[KoraxMissile]() * (45/256.); if (dest.bShadow)
{ // Invisible target
an += Random2[KoraxMissile]() * (45/256.);
}
th.angle = an;
th.VelFromAngle();
double dist = dest.DistanceBySpeed(th, th.Speed);
th.Vel.Z = (dest.pos.z - pos.Z + 30) / dist;
th.CheckMissileSpawn(radius);
} }
th.angle = an;
th.VelFromAngle();
double dist = dest.DistanceBySpeed(th, th.Speed);
th.Vel.Z = (dest.pos.z - pos.Z + 30) / dist;
th.CheckMissileSpawn(radius);
} }
//============================================================================ //============================================================================

View file

@ -262,7 +262,7 @@ class Minotaur : Actor
type = "PunchPuff"; type = "PunchPuff";
} }
Actor puff = Spawn (type, Pos, ALLOW_REPLACE); Actor puff = Spawn (type, Pos, ALLOW_REPLACE);
puff.Vel.Z = 2; if (puff != null) puff.Vel.Z = 2;
special1--; special1--;
} }
else else
@ -710,9 +710,12 @@ class MinotaurFX2 : MinotaurFX1
double y = Random2[MntrFloorFire]() / 64.; double y = Random2[MntrFloorFire]() / 64.;
Actor mo = Spawn("MinotaurFX3", Vec2OffsetZ(x, y, floorz), ALLOW_REPLACE); Actor mo = Spawn("MinotaurFX3", Vec2OffsetZ(x, y, floorz), ALLOW_REPLACE);
mo.target = target; if (mo != null)
mo.Vel.X = MinVel; // Force block checking {
mo.CheckMissileSpawn (radius); mo.target = target;
mo.Vel.X = MinVel; // Force block checking
mo.CheckMissileSpawn (radius);
}
} }
} }

View file

@ -202,9 +202,12 @@ class EntityBoss : SpectralMonster
Vector3 pos = spot.Vec3Angle(secondRadius, an, tracer ? 70. : 0.); Vector3 pos = spot.Vec3Angle(secondRadius, an, tracer ? 70. : 0.);
second = Spawn("EntitySecond", pos, ALLOW_REPLACE); second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
second.CopyFriendliness(self, true); if (second != null)
second.A_FaceTarget(); {
second.VelFromAngle(i == 0? 4.8828125 : secondRadius * 4., an); second.CopyFriendliness(self, true);
second.A_FaceTarget();
second.VelFromAngle(i == 0? 4.8828125 : secondRadius * 4., an);
}
} }
} }

View file

@ -171,9 +171,12 @@ class Inquisitor : Actor
void A_TossArm () void A_TossArm ()
{ {
Actor foo = Spawn("InquisitorArm", Pos + (0,0,24), ALLOW_REPLACE); Actor foo = Spawn("InquisitorArm", Pos + (0,0,24), ALLOW_REPLACE);
foo.angle = angle - 90. + Random2[Inquisitor]() * (360./1024.); if (foo != null)
foo.VelFromAngle(foo.Speed / 8); {
foo.Vel.Z = random[Inquisitor]() / 64.; foo.angle = angle - 90. + Random2[Inquisitor]() * (360./1024.);
foo.VelFromAngle(foo.Speed / 8);
foo.Vel.Z = random[Inquisitor]() / 64.;
}
} }

View file

@ -163,6 +163,10 @@ class TeleporterBeacon : Inventory
{ {
Actor owner = target; Actor owner = target;
Actor rebel = Spawn("Rebel1", (pos.xy, floorz), ALLOW_REPLACE); Actor rebel = Spawn("Rebel1", (pos.xy, floorz), ALLOW_REPLACE);
if (rebel == null)
{
return;
}
if (!rebel.TryMove (rebel.Pos.xy, true)) if (!rebel.TryMove (rebel.Pos.xy, true))
{ {
rebel.Destroy (); rebel.Destroy ();

View file

@ -268,7 +268,7 @@ class Sigil : Weapon
action void A_FireSigil1 () action void A_FireSigil1 ()
{ {
Actor spot; Actor spot = null;
FTranslatedLineTarget t; FTranslatedLineTarget t;
if (player == null || player.ReadyWeapon == null) if (player == null || player.ReadyWeapon == null)

View file

@ -62,11 +62,13 @@ class SpectralMonster : Actor
return; return;
Actor foo = Spawn("SpectralLightningV2", Pos + (0, 0, 32), ALLOW_REPLACE); Actor foo = Spawn("SpectralLightningV2", Pos + (0, 0, 32), ALLOW_REPLACE);
if (foo != null)
foo.Vel.Z = -12; {
foo.target = self; foo.Vel.Z = -12;
foo.FriendPlayer = 0; foo.target = self;
foo.tracer = target; foo.FriendPlayer = 0;
foo.tracer = target;
}
Angle -= 90.; Angle -= 90.;
for (int i = 0; i < 20; ++i) for (int i = 0; i < 20; ++i)
@ -217,9 +219,11 @@ class SpectralLightningH1 : SpectralLightningBase
void A_SpectralLightningTail () void A_SpectralLightningTail ()
{ {
Actor foo = Spawn("SpectralLightningHTail", Vec3Offset(-Vel.X, -Vel.Y, 0.), ALLOW_REPLACE); Actor foo = Spawn("SpectralLightningHTail", Vec3Offset(-Vel.X, -Vel.Y, 0.), ALLOW_REPLACE);
if (foo != null)
foo.Angle = Angle; {
foo.FriendPlayer = FriendPlayer; foo.Angle = Angle;
foo.FriendPlayer = FriendPlayer;
}
} }
} }
@ -386,15 +390,21 @@ class SpectralLightningSpot : SpectralLightningDeath1
Actor flash = Spawn (cls, Vec2OffsetZ(xo, yo, ONCEILINGZ), ALLOW_REPLACE); Actor flash = Spawn (cls, Vec2OffsetZ(xo, yo, ONCEILINGZ), ALLOW_REPLACE);
flash.target = target; if (flash != null)
flash.Vel.Z = -18; {
flash.FriendPlayer = FriendPlayer; flash.target = target;
flash.Vel.Z = -18;
flash.FriendPlayer = FriendPlayer;
}
flash = Spawn("SpectralLightningV2", (pos.xy, ONCEILINGZ), ALLOW_REPLACE); flash = Spawn("SpectralLightningV2", (pos.xy, ONCEILINGZ), ALLOW_REPLACE);
flash.target = target; if (flash != null)
flash.Vel.Z = -18; {
flash.FriendPlayer = FriendPlayer; flash.target = target;
flash.Vel.Z = -18;
flash.FriendPlayer = FriendPlayer;
}
} }
} }

View file

@ -133,7 +133,10 @@ extend class Actor
void A_DropFire() void A_DropFire()
{ {
Actor drop = Spawn("FireDroplet", pos + (0,0,24), ALLOW_REPLACE); Actor drop = Spawn("FireDroplet", pos + (0,0,24), ALLOW_REPLACE);
drop.Vel.Z = -1.; if (drop != null)
{
drop.Vel.Z = -1.;
}
A_Explode(64, 64, XF_NOSPLASH, damagetype: 'Fire'); A_Explode(64, 64, XF_NOSPLASH, damagetype: 'Fire');
} }