From 7acf43741adf16f8360f093859cf533bdb25464b Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Fri, 28 Dec 2018 10:20:12 -0600 Subject: [PATCH] Fixed: IsFakePain received the modified damage instead of the raw, preventing ALLOWPAIN from working as intended. --- src/p_interaction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index e926de50a..1cac172b3 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -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) {