- 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.

This commit is contained in:
Christoph Oelckers 2014-10-25 00:52:27 +02:00
parent 5ac7e4fc38
commit 83be901ad6

View file

@ -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