Add WorldRailgunFired

This commit is contained in:
Cacodemon345 2024-11-21 13:10:17 +06:00 committed by Rachael Alexanderson
commit 26cff374de
4 changed files with 34 additions and 1 deletions

View file

@ -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)