- fixed recreation of state lights

This must also happen if the previous state had a light but the current one does not.
This commit is contained in:
Christoph Oelckers 2021-10-19 08:07:06 +02:00
parent 8ec6c21195
commit 047c0c9537

View file

@ -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;