- Fixed: The 0-damage FORCEPAIN checks in P_DamageMobj() also need to check the PAINLESS and NOPAIN flags.

SVN r3573 (trunk)
This commit is contained in:
Randy Heit 2012-04-19 03:40:27 +00:00
parent 5b86ce9f7d
commit b036ef63e9

View file

@ -985,8 +985,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
source->Inventory->ModifyDamage(olddam, mod, damage, false);
if (olddam != damage && damage <= 0)
{ // Still allow FORCEPAIN
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
if (!(target->flags5 & MF5_NOPAIN) && inflictor != NULL &&
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS))
{
goto dopain;
}
return;
}
}
@ -997,8 +1000,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
target->Inventory->ModifyDamage(olddam, mod, damage, true);
if (olddam != damage && damage <= 0)
{ // Still allow FORCEPAIN
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
if (!(target->flags5 & MF5_NOPAIN) && inflictor != NULL &&
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS))
{
goto dopain;
}
return;
}
}
@ -1012,8 +1018,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
}
if (damage <= 0)
{ // Still allow FORCEPAIN
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
if (!(target->flags5 & MF5_NOPAIN) && inflictor != NULL &&
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS))
{
goto dopain;
}
return;
}
}
@ -1146,8 +1155,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
if (damage <= 0)
{
// If MF6_FORCEPAIN is set, make the player enter the pain state.
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
if (!(target->flags5 & MF5_NOPAIN) && inflictor != NULL &&
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS))
{
goto dopain;
}
return;
}
}