From 83be901ad6f3254b1cd470ec1bf5faa7e60a36ea Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Oct 2014 00:52:27 +0200 Subject: [PATCH] - fixed: damage of amount TELEFRAG_DAMAGE should not be reduced by armors absorbing some damage, it'd lose its magic-ness, that is needed to ensure a guaranteed kill. The same applies to autousing health items. --- src/p_interaction.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index fad7a42e5..4a960cc17 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1218,8 +1218,13 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, if (!(flags & DMG_NO_ARMOR) && player->mo->Inventory != NULL) { int newdam = damage; - player->mo->Inventory->AbsorbDamage (damage, mod, newdam); - damage = newdam; + player->mo->Inventory->AbsorbDamage(damage, mod, newdam); + if (damage < TELEFRAG_DAMAGE) + { + // if we are telefragging don't let the damage value go below that magic value. Some further checks would fail otherwise. + damage = newdam; + } + if (damage <= 0) { // If MF6_FORCEPAIN is set, make the player enter the pain state. @@ -1232,7 +1237,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, } } - if (damage >= player->health + if (damage >= player->health && damage < TELEFRAG_DAMAGE && && (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch) && !player->morphTics) { // Try to use some inventory health