Since WorldThingDestroyed is the reverse of WorldThingSpawned, it should ignore actors that didn't call PostBeginPlay.
This commit is contained in:
parent
89c475c2d1
commit
26d38e6527
3 changed files with 6 additions and 0 deletions
|
|
@ -273,6 +273,10 @@ void E_WorldThingDestroyed(AActor* actor)
|
|||
// don't call anything if actor was destroyed on PostBeginPlay/BeginPlay/whatever.
|
||||
if (actor->ObjectFlags & OF_EuthanizeMe)
|
||||
return;
|
||||
// don't call anything for non-spawned things (i.e. those that were created, but immediately destroyed)
|
||||
// this is because Destroyed should be reverse of Spawned. we don't want to catch random inventory give failures.
|
||||
if (!(actor->ObjectFlags & OF_Spawned))
|
||||
return;
|
||||
for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next)
|
||||
handler->WorldThingDestroyed(actor);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue