WorldRailgunFired flags are now passed properly

There's also a new DamageMobj flag to indicate railgun attacks without
having to rely on damagetypes.
This commit is contained in:
Cacodemon345 2025-06-25 00:23:45 +06:00 committed by Ricardo Luís Vaz Silva
commit 028256f06f
3 changed files with 4 additions and 2 deletions

View file

@ -5587,7 +5587,7 @@ void P_RailAttack(FRailParams *p)
if (puffDefaults->flags7 & MF7_FOILBUDDHA) dmgFlagPass |= DMG_FOILBUDDHA;
}
// [RK] If the attack source is a player, send the DMG_PLAYERATTACK flag.
int newdam = P_DamageMobj(hitactor, hitpuff ? hitpuff : source, source, p->damage, damagetype, dmgFlagPass | DMG_USEANGLE | (source->player ? DMG_PLAYERATTACK : 0), hitangle);
int newdam = P_DamageMobj(hitactor, hitpuff ? hitpuff : source, source, p->damage, damagetype, dmgFlagPass | DMG_USEANGLE | (source->player ? DMG_PLAYERATTACK : 0) | DMG_RAILGUN, hitangle);
if (bleed)
{
@ -5630,7 +5630,7 @@ void P_RailAttack(FRailParams *p)
}
}
source->Level->localEventManager->WorldRailgunFired(source, start, trace.HitPos, thepuff, flags);
source->Level->localEventManager->WorldRailgunFired(source, start, trace.HitPos, thepuff, p->flags);
if (thepuff != NULL)
{