From 94a80dda118bcbfbb2b71f607b806a5241430b7f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2023 17:25:47 +0200 Subject: [PATCH] - initialize the angle of script spawned actors. --- source/games/duke/src/spawn.cpp | 5 +++++ wadsrc/static/zscript/games/duke/dukeactor.zs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 991be8fa7..eb2f5eeb3 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -846,6 +846,11 @@ DDukeActor* spawninit(DDukeActor* actj, DDukeActor* act, TArray* ac } commonEnemySetup(act, actj); } + else if (!(act->flags3 & SFLAG3_SIMPLEINIT)) + { + act->ownerActor = actj; + } + CallInitialize(act); } else diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index a4c9b30e2..8ffadff70 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -422,7 +422,8 @@ class DukeActor : CoreActor native } self.clipdist = 10; - self.ownerActor = self; + if (self.ownerActor == null) self.ownerActor = self; + else self.angle = self.ownerActor.angle; self.ChangeStat(STAT_ACTOR); } }