From 1210e1a951cca43e3328f44415d882c462e33008 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Thu, 13 Sep 2018 09:42:34 -0500 Subject: [PATCH] Added DMG_EXPLOSION flag. - This allows modders to determine if damage is caused by an actual explosion, assigned by P_RadiusAttack and BlastActor for +TOUCHY actors. --- src/p_local.h | 1 + src/p_map.cpp | 4 ++-- wadsrc/static/zscript/constants.txt | 1 + wadsrc/static/zscript/hexen/blastradius.txt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 08c128847..d1a81a992 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -453,6 +453,7 @@ enum EDmgFlags DMG_NO_PROTECT = 256, DMG_USEANGLE = 512, DMG_NO_PAIN = 1024, + DMG_EXPLOSION = 2048, }; diff --git a/src/p_map.cpp b/src/p_map.cpp index a44d37c72..58c0bb706 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -6177,7 +6177,7 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom { //[MC] Don't count actors saved by buddha if already at 1 health. int prehealth = thing->health; - newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod); + newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, DMG_EXPLOSION); if (thing->health < prehealth) count++; } else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_DONTTHRUST))) @@ -6229,7 +6229,7 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom { // OK to damage; target is in direct path //[MC] Don't count actors saved by buddha if already at 1 health. int prehealth = thing->health; - int newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod); + int newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, DMG_EXPLOSION); P_TraceBleed(newdam > 0 ? newdam : damage, thing, bombspot); if (thing->health < prehealth) count++; } diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 156763a27..dc394a0d2 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -939,6 +939,7 @@ enum EDmgFlags DMG_NO_PROTECT = 256, DMG_USEANGLE = 512, DMG_NO_PAIN = 1024, + DMG_EXPLOSION = 2048, } enum EReplace diff --git a/wadsrc/static/zscript/hexen/blastradius.txt b/wadsrc/static/zscript/hexen/blastradius.txt index 3dd355b7c..0f5094892 100644 --- a/wadsrc/static/zscript/hexen/blastradius.txt +++ b/wadsrc/static/zscript/hexen/blastradius.txt @@ -89,7 +89,7 @@ extend class Actor if (victim.bTouchy) { // Touchy objects die when blasted victim.bArmed = false; // Disarm - victim.DamageMobj(self, self, victim.health, 'Melee', DMG_FORCED); + victim.DamageMobj(self, self, victim.health, 'Melee', DMG_FORCED|DMG_EXPLOSION); } }