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.
This commit is contained in:
Major Cooke 2018-09-13 09:42:34 -05:00 committed by Christoph Oelckers
parent c988a0b3a4
commit 1210e1a951
4 changed files with 5 additions and 3 deletions

View File

@ -453,6 +453,7 @@ enum EDmgFlags
DMG_NO_PROTECT = 256,
DMG_USEANGLE = 512,
DMG_NO_PAIN = 1024,
DMG_EXPLOSION = 2048,
};

View File

@ -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++;
}

View File

@ -939,6 +939,7 @@ enum EDmgFlags
DMG_NO_PROTECT = 256,
DMG_USEANGLE = 512,
DMG_NO_PAIN = 1024,
DMG_EXPLOSION = 2048,
}
enum EReplace

View File

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