- 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
This commit is contained in:
alexey.lysiuk 2019-08-20 17:17:34 +03:00 committed by drfrag
parent 32184dbca2
commit 79eadafa6b
2 changed files with 4 additions and 1 deletions

View file

@ -153,6 +153,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)

View file

@ -84,12 +84,12 @@ class DynamicLight : Actor
override void BeginPlay()
{
ChangeStatNum(STAT_DLIGHT);
AttachLight();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
AttachLight();
if (!(SpawnFlags & MTF_DORMANT))
{