From c03be3b43b9bd2490286519feb19164c331a027c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 15 Apr 2012 03:48:27 +0000 Subject: [PATCH] - Fixed: Don't ignore FORCEPAIN if damage modification takes the damage to 0. SVN r3567 (trunk) --- src/p_interaction.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 1947eaf303..1df327fab3 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -984,7 +984,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage int olddam = damage; source->Inventory->ModifyDamage(olddam, mod, damage, false); if (olddam != damage && damage <= 0) + { // Still allow FORCEPAIN + if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)) + goto dopain; return; + } } // Handle passive damage modifiers (e.g. PowerProtection) if (target->Inventory != NULL) @@ -992,17 +996,26 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage int olddam = damage; target->Inventory->ModifyDamage(olddam, mod, damage, true); if (olddam != damage && damage <= 0) + { // Still allow FORCEPAIN + if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)) + goto dopain; return; + } } if (!(flags & DMG_NO_FACTOR)) { damage = FixedMul(damage, target->DamageFactor); - if (damage < 0) - return; - damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->ActorInfo->DamageFactors); + if (damage >= 0) + { + damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->ActorInfo->DamageFactors); + } if (damage <= 0) + { // Still allow FORCEPAIN + if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)) + goto dopain; return; + } } damage = target->TakeSpecialDamage (inflictor, source, damage, mod);