Fixed: IsFakePain received the modified damage instead of the raw, preventing ALLOWPAIN from working as intended.

This commit is contained in:
Major Cooke 2018-12-28 10:20:12 -06:00 committed by Christoph Oelckers
parent c499c563a0
commit 7acf43741a

View file

@ -801,7 +801,7 @@ static inline bool isFakePain(AActor *target, AActor *inflictor, int damage)
}
// [MC] Completely ripped out of DamageMobj to make it less messy.
static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags)
static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags, int originaldamage)
{
bool justhit = false;
int painchance = 0;
@ -827,7 +827,7 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int
// Are we attempting to cause pain?
if (!noPain)
{
fakedPain = (isFakePain(target, inflictor, damage));
fakedPain = (isFakePain(target, inflictor, originaldamage));
forcedPain = (MustForcePain(target, inflictor));
}
@ -1456,7 +1456,7 @@ static int DoDamageMobj(AActor *target, AActor *inflictor, AActor *source, int d
bool needevent = true;
int realdamage = DamageMobj(target, inflictor, source, damage, mod, flags, angle, needevent);
if (realdamage >= 0) //Keep this check separated. Mods relying upon negative numbers may break otherwise.
ReactToDamage(target, inflictor, source, realdamage, mod, flags);
ReactToDamage(target, inflictor, source, realdamage, mod, flags, damage);
if (realdamage > 0 && needevent)
{