From 028256f06ffbdabc2b4677d7e604fb8860832ecb Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 25 Jun 2025 00:23:45 +0600 Subject: [PATCH] WorldRailgunFired flags are now passed properly There's also a new DamageMobj flag to indicate railgun attacks without having to rely on damagetypes. --- src/playsim/p_local.h | 1 + src/playsim/p_map.cpp | 4 ++-- wadsrc/static/zscript/constants.zs | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/playsim/p_local.h b/src/playsim/p_local.h index 6575ad3e5..f45aae071 100644 --- a/src/playsim/p_local.h +++ b/src/playsim/p_local.h @@ -456,6 +456,7 @@ enum EDmgFlags DMG_NO_PAIN = 1024, DMG_EXPLOSION = 2048, DMG_NO_ENHANCE = 4096, + DMG_RAILGUN = 8192, }; diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 5b427e0f7..9cc66b98d 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -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) { diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index cf1140a10..8bb1af77f 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -977,6 +977,7 @@ enum EDmgFlags DMG_NO_PAIN = 1024, DMG_EXPLOSION = 2048, DMG_NO_ENHANCE = 4096, + DMG_RAILGUN = 8192, } enum EReplace