From d940c6a2eecb2b4897433791d897a8712cfe8e3b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 31 Mar 2015 23:15:43 +0200 Subject: [PATCH] - fixed: With the recent changes to the damage code, the check for MF5_NODAMAGE was too early. Putting it into AActor::TakeSpecialDamage is also not the best idea because that limits that function's potential. --- src/p_interaction.cpp | 5 +++++ src/p_mobj.cpp | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index a16069c7b..a309360c4 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1038,6 +1038,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, // Invulnerable, and won't wake up return -1; } + if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect. { player = target->player; @@ -1116,6 +1117,10 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, return -1; } } + if (target->flags5 & MF5_NODAMAGE) + { + damage = 0; + } } } if (damage < 0) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 23fb9cf3c..c12bd53db 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -6159,11 +6159,6 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN { FState *death; - if (flags5 & MF5_NODAMAGE) - { - return 0; - } - // If the actor does not have a corresponding death state, then it does not take damage. // Note that DeathState matches every kind of damagetype, so an actor has that, it can // be hurt with any type of damage. Exception: Massacre damage always succeeds, because