Add WorldRailgunFired
This commit is contained in:
parent
db6294c48a
commit
26cff374de
4 changed files with 34 additions and 1 deletions
|
|
@ -752,6 +752,18 @@ void EventManager::WorldHitscanFired(AActor* actor, const DVector3& AttackPos, c
|
|||
handler->WorldHitscanFired(actor, AttackPos, DamagePosition, Inflictor, flags);
|
||||
}
|
||||
|
||||
void EventManager::WorldRailgunFired(AActor* actor, const DVector3& AttackPos, const DVector3& DamagePosition, AActor* Inflictor, int flags)
|
||||
{
|
||||
// don't call anything if actor was destroyed on PostBeginPlay/BeginPlay/whatever.
|
||||
if (actor->ObjectFlags & OF_EuthanizeMe)
|
||||
return;
|
||||
|
||||
if (ShouldCallStatic(true)) staticEventManager.WorldRailgunFired(actor, AttackPos, DamagePosition, Inflictor, flags);
|
||||
|
||||
for (DStaticEventHandler* handler = FirstEventHandler; handler; handler = handler->next)
|
||||
handler->WorldRailgunFired(actor, AttackPos, DamagePosition, Inflictor, flags);
|
||||
}
|
||||
|
||||
void EventManager::WorldThingGround(AActor* actor, FState* st)
|
||||
{
|
||||
// don't call anything if actor was destroyed on PostBeginPlay/BeginPlay/whatever.
|
||||
|
|
@ -1865,6 +1877,23 @@ void DStaticEventHandler::WorldHitscanFired(AActor* actor, const DVector3& Attac
|
|||
}
|
||||
}
|
||||
|
||||
void DStaticEventHandler::WorldRailgunFired(AActor* actor, const DVector3& AttackPos, const DVector3& DamagePosition, AActor* Inflictor, int flags)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, WorldRailgunFired)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (isEmpty(func)) return;
|
||||
FWorldEvent e = owner->SetupWorldEvent();
|
||||
e.Thing = actor;
|
||||
e.AttackPos = AttackPos;
|
||||
e.DamagePosition = DamagePosition;
|
||||
e.Inflictor = Inflictor;
|
||||
e.AttackLineFlags = flags;
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, &e };
|
||||
VMCall(func, params, 2, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void DStaticEventHandler::WorldThingGround(AActor* actor, FState* st)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, WorldThingGround)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue