From 37fa2e1b673412d6814d4fa4b0547b3b567af0f9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 20 Aug 2019 17:17:34 +0300 Subject: [PATCH] - fixed initial setup for dynamic light actors They are attached and actived explicitly during usual actor initialization sequence Postponed processing applicable to so called user dynamic lights must be skipped for them RECREATELIGHTS flag handling for dynamic light actors had the opposite effect of deactivating them https://forum.zdoom.org/viewtopic.php?t=65683 --- src/playsim/a_dynlight.cpp | 3 +++ wadsrc/static/zscript/actors/shared/dynlights.zs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/playsim/a_dynlight.cpp b/src/playsim/a_dynlight.cpp index 686230e0b..504855421 100644 --- a/src/playsim/a_dynlight.cpp +++ b/src/playsim/a_dynlight.cpp @@ -122,6 +122,9 @@ void AttachLight(AActor *self) light->visibletoplayer = true; light->lighttype = (uint8_t)self->IntVar(NAME_lighttype); self->AttachedLights.Push(light); + + // Disable postponed processing of dynamic light because its setup has been completed by this function + self->flags8 &= ~MF8_RECREATELIGHTS; } DEFINE_ACTION_FUNCTION_NATIVE(ADynamicLight, AttachLight, AttachLight) diff --git a/wadsrc/static/zscript/actors/shared/dynlights.zs b/wadsrc/static/zscript/actors/shared/dynlights.zs index 388e8f244..4f6ada88f 100644 --- a/wadsrc/static/zscript/actors/shared/dynlights.zs +++ b/wadsrc/static/zscript/actors/shared/dynlights.zs @@ -84,12 +84,12 @@ class DynamicLight : Actor override void BeginPlay() { ChangeStatNum(STAT_DLIGHT); - AttachLight(); } override void PostBeginPlay() { Super.PostBeginPlay(); + AttachLight(); if (!(SpawnFlags & MTF_DORMANT)) {