- fixed incomplete statnum setup.

This commit is contained in:
Christoph Oelckers 2023-01-09 23:39:20 +01:00
parent b7799a5a3c
commit b991af2dbc
2 changed files with 2 additions and 1 deletions

View file

@ -358,6 +358,7 @@ DCoreActor* InsertActor(PClass* type, sectortype* sector, int stat, bool tail)
auto defaults = GetDefaultByType(type);
auto actorinfo = static_cast<PClassActor*>(actor->GetClass())->ActorInfo();
if (actorinfo && actorinfo->DefaultFlags & DEFF_STATNUM) stat = defaults->spr.statnum;
if (stat == -1) stat = 0;
GC::WriteBarrier(actor);
InsertActorStat(actor, stat, tail);

View file

@ -35,7 +35,7 @@ class DukeFireext : DukeActor
let a = frandom(0, 360);
let vel = frandom(0, 4) + 4;
let zvel = -frandom(0, 16) - self.vel.Z * 0.25;
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(frandom(-48, 0)), 'DukeScrap', -8, (0.75, 0.75), a, vel, zvel, self);
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(frandom(-48, 0)), 'DukeScrap', -8, (0.75, 0.75), a, vel, zvel, self, STAT_MISC);
if (spawned)
{
if (spawned) spawned.spriteextra = DukeScrap.Scrap3 + random(0, 3);