Added WorldThingGround event to hook into the actor at exact moment its corpse spawns gibs upon being crushed.
This commit is contained in:
parent
54f85d4caa
commit
7285c5aca8
4 changed files with 33 additions and 1 deletions
|
|
@ -331,6 +331,18 @@ void EventManager::WorldThingDied(AActor* actor, AActor* inflictor)
|
|||
handler->WorldThingDied(actor, inflictor);
|
||||
}
|
||||
|
||||
void EventManager::WorldThingGround(AActor* actor)
|
||||
{
|
||||
// don't call anything if actor was destroyed on PostBeginPlay/BeginPlay/whatever.
|
||||
if (actor->ObjectFlags & OF_EuthanizeMe)
|
||||
return;
|
||||
|
||||
if (ShouldCallStatic(true)) staticEventManager.WorldThingGround(actor);
|
||||
|
||||
for (DStaticEventHandler* handler = FirstEventHandler; handler; handler = handler->next)
|
||||
handler->WorldThingGround(actor);
|
||||
}
|
||||
|
||||
void EventManager::WorldThingRevived(AActor* actor)
|
||||
{
|
||||
// don't call anything if actor was destroyed on PostBeginPlay/BeginPlay/whatever.
|
||||
|
|
@ -795,6 +807,20 @@ void DStaticEventHandler::WorldThingDied(AActor* actor, AActor* inflictor)
|
|||
}
|
||||
}
|
||||
|
||||
void DStaticEventHandler::WorldThingGround(AActor* actor)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, WorldThingGround)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (isEmpty(func)) return;
|
||||
FWorldEvent e = owner->SetupWorldEvent();
|
||||
e.Thing = actor;
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, &e };
|
||||
VMCall(func, params, 2, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DStaticEventHandler::WorldThingRevived(AActor* actor)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, WorldThingRevived)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue