Fixes for dynamic lights
Fixed released lights not unlinking in rare cases. Fixed first Actor in cache being missed when destruction checking. Fixed results cache not being cleared on update.
This commit is contained in:
parent
f127c2c164
commit
b68c7545cd
1 changed files with 7 additions and 4 deletions
|
|
@ -305,6 +305,7 @@ void FDynamicLight::Tick()
|
|||
if (!target)
|
||||
{
|
||||
// How did we get here? :?
|
||||
UnlinkLight();
|
||||
ReleaseLight();
|
||||
return;
|
||||
}
|
||||
|
|
@ -444,16 +445,18 @@ void FDynamicLight::Tick()
|
|||
if(updated)
|
||||
{
|
||||
ActorList.Clear();
|
||||
ActorResult.Clear();
|
||||
}
|
||||
else if(ActorList.Size() > 0)
|
||||
{
|
||||
unsigned i = ActorList.Size() - 1;
|
||||
unsigned i = ActorList.Size();
|
||||
while(i > 0)
|
||||
{
|
||||
if(ActorList[i]->ObjectFlags & OF_EuthanizeMe)
|
||||
const unsigned index = i - 1u;
|
||||
if(ActorList[index]->ObjectFlags & OF_EuthanizeMe)
|
||||
{
|
||||
ActorList.Delete(i);
|
||||
ActorResult.Delete(i);
|
||||
ActorList.Delete(index);
|
||||
ActorResult.Delete(index);
|
||||
}
|
||||
i--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue