From a0c7be913839add1e4e8872e53a16c2f2efc8cd2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 2 Dec 2022 12:46:11 +0100 Subject: [PATCH] - 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. --- source/games/duke/src/actors_r.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 59fa93006..b49088763 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -2309,7 +2309,8 @@ static int henstand(DDukeActor *actor) if (actor->spr.lotag == 0) { spawn(actor, HEN); - actor->Destroy(); + actor->spr.scale.Zero(); + ChangeActorStat(actor, STAT_MISC); return 1; } } @@ -2334,7 +2335,8 @@ static int henstand(DDukeActor *actor) if (hitact->spr.picnum == HEN) { auto ns = spawn(hitact, HENSTAND); - hitact->Destroy(); + hitact->spr.scale.Zero(); + ChangeActorStat(hitact, STAT_MISC); if (ns) { ns->vel.X = 2;