From 3ef60a40a551f18f32a954bc0ac0363caf2a8f5b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 24 Sep 2021 08:33:37 +0200 Subject: [PATCH] - fixed particle processing in the main thinker loop This may not be guarded by the dynamic light flags, only the light ticking may. --- src/playsim/dthinker.cpp | 6 +++--- src/playsim/p_mobj.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playsim/dthinker.cpp b/src/playsim/dthinker.cpp index 32722f91c..cabdf8668 100644 --- a/src/playsim/dthinker.cpp +++ b/src/playsim/dthinker.cpp @@ -129,7 +129,7 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) if (ac->flags8 & MF8_RECREATELIGHTS) { ac->flags8 &= ~MF8_RECREATELIGHTS; - ac->SetDynamicLights(); + if (dolights) ac->SetDynamicLights(); } // This was merged from P_RunEffects to eliminate the costly duplicate ThinkerIterator loop. if ((ac->effects || ac->fountaincolor) && !Level->isFrozen()) @@ -157,9 +157,9 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) } } while (count != 0); + recreateLights(); if (dolights) { - recreateLights(); for (auto light = Level->lights; light;) { auto next = light->next; @@ -187,9 +187,9 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) } } while (count != 0); + recreateLights(); if (dolights) { - recreateLights(); // Also profile the internal dynamic lights, even though they are not implemented as thinkers. auto &prof = Profiles[NAME_InternalDynamicLight]; prof.timer.Clock(); diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 3c59764be..8ca386766 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -4803,7 +4803,7 @@ void AActor::PostBeginPlay () { PrevAngles = Angles; flags7 |= MF7_HANDLENODELAY; - if (GetInfo()->LightAssociations.Size()) + if (GetInfo()->LightAssociations.Size() || (state && state->Light > 0)) { flags8 |= MF8_RECREATELIGHTS; Level->flags3 |= LEVEL3_LIGHTCREATED;