From 7b7334e245e26e8f2697316c63c54d6b79e28ad8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 31 Jan 2019 09:01:02 +0100 Subject: [PATCH] - only activate lights if the light actor isn't dormant, and only create a new one if it doesn't already have one. - --- src/g_shared/a_dynlight.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/g_shared/a_dynlight.cpp b/src/g_shared/a_dynlight.cpp index 4c57648c4..701e22853 100644 --- a/src/g_shared/a_dynlight.cpp +++ b/src/g_shared/a_dynlight.cpp @@ -854,15 +854,18 @@ void AActor::RecreateAllAttachedLights() while ((a=it.Next())) { - if (a->IsKindOf(NAME_DynamicLight)) - { - ::AttachLight(a); - ::ActivateLight(a); - } - else + if (!a->IsKindOf(NAME_DynamicLight)) { a->SetDynamicLights(); } + else if (a->AttachedLights.Size() == 0) + { + ::AttachLight(a); + if (!(a->flags2 & MF2_DORMANT)) + { + ::ActivateLight(a); + } + } } }