Added INFLICTORDMGTYPE flag to A_Damage* action functions

It forces the use of the inflictor's damagetype instead of whatever is
passed to the functions.
This commit is contained in:
Blue-Shadow 2016-07-19 04:59:07 +03:00 committed by Christoph Oelckers
parent d09ec5a930
commit c428e376cd
2 changed files with 5 additions and 0 deletions

View file

@ -6129,6 +6129,7 @@ enum DMSS
DMSS_EXFILTER = 64, //Changes filter into a blacklisted class instead of whitelisted.
DMSS_EXSPECIES = 128, // ^ but with species instead.
DMSS_EITHER = 256, //Allow either type or species to be affected.
DMSS_INFLICTORDMGTYPE = 512, //Ignore the passed damagetype and use the inflictor's instead.
};
static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int amount, FName DamageType, int flags, PClassActor *filter, FName species)
@ -6153,6 +6154,9 @@ static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int a
if (amount > 0)
{ //Should wind up passing them through just fine.
if (flags & DMSS_INFLICTORDMGTYPE)
DamageType = inflictor->DamageType;
P_DamageMobj(dmgtarget, inflictor, source, amount, DamageType, dmgFlags);
}
else if (amount < 0)

View file

@ -466,6 +466,7 @@ enum
DMSS_EXFILTER = 0x00000040,
DMSS_EXSPECIES = 0x00000080,
DMSS_EITHER = 0x00000100,
DMSS_INFLICTORDMGTYPE = 0x00000200,
};
// Flags for A_AlertMonsters