- try to address some occasional crash with chickens on the bowling lane.

Since this frequently swaps out some actors, it may be advisable to delay destruction by one frame to avoid actor chain consistency issues by writing into the just destroyed object.
This commit is contained in:
Christoph Oelckers 2022-12-02 12:46:11 +01:00
parent a580e9d884
commit a0c7be9138

View file

@ -2309,7 +2309,8 @@ static int henstand(DDukeActor *actor)
if (actor->spr.lotag == 0) if (actor->spr.lotag == 0)
{ {
spawn(actor, HEN); spawn(actor, HEN);
actor->Destroy(); actor->spr.scale.Zero();
ChangeActorStat(actor, STAT_MISC);
return 1; return 1;
} }
} }
@ -2334,7 +2335,8 @@ static int henstand(DDukeActor *actor)
if (hitact->spr.picnum == HEN) if (hitact->spr.picnum == HEN)
{ {
auto ns = spawn(hitact, HENSTAND); auto ns = spawn(hitact, HENSTAND);
hitact->Destroy(); hitact->spr.scale.Zero();
ChangeActorStat(hitact, STAT_MISC);
if (ns) if (ns)
{ {
ns->vel.X = 2; ns->vel.X = 2;