From 047c0c9537c06d3e4289e0bcaaa359373c5d74e4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 19 Oct 2021 08:07:06 +0200 Subject: [PATCH] - fixed recreation of state lights This must also happen if the previous state had a light but the current one does not. --- src/playsim/p_mobj.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 7416221270..a9674122b5 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -499,6 +499,8 @@ bool AActor::SetState (FState *newstate, bool nofunction) { if (debugfile && player && (player->cheats & CF_PREDICTING)) fprintf (debugfile, "for pl %d: SetState while predicting!\n", Level->PlayerNum(player)); + + auto oldstate = state; do { if (newstate == NULL) @@ -584,7 +586,7 @@ bool AActor::SetState (FState *newstate, bool nofunction) newstate = newstate->GetNextState(); } while (tics == 0); - if (GetInfo()->LightAssociations.Size() || (state && state->Light > 0)) + if (GetInfo()->LightAssociations.Size() || (state && state->Light > 0) || (oldstate && oldstate->Light > 0)) { flags8 |= MF8_RECREATELIGHTS; Level->flags3 |= LEVEL3_LIGHTCREATED;