mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
- Fixed: Don't ignore FORCEPAIN if damage modification takes the damage to 0.
SVN r3567 (trunk)
This commit is contained in:
parent
aa227b1df4
commit
c03be3b43b
1 changed files with 16 additions and 3 deletions
|
@ -984,7 +984,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
int olddam = damage;
|
int olddam = damage;
|
||||||
source->Inventory->ModifyDamage(olddam, mod, damage, false);
|
source->Inventory->ModifyDamage(olddam, mod, damage, false);
|
||||||
if (olddam != damage && damage <= 0)
|
if (olddam != damage && damage <= 0)
|
||||||
|
{ // Still allow FORCEPAIN
|
||||||
|
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
|
||||||
|
goto dopain;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Handle passive damage modifiers (e.g. PowerProtection)
|
// Handle passive damage modifiers (e.g. PowerProtection)
|
||||||
if (target->Inventory != NULL)
|
if (target->Inventory != NULL)
|
||||||
|
@ -992,17 +996,26 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
int olddam = damage;
|
int olddam = damage;
|
||||||
target->Inventory->ModifyDamage(olddam, mod, damage, true);
|
target->Inventory->ModifyDamage(olddam, mod, damage, true);
|
||||||
if (olddam != damage && damage <= 0)
|
if (olddam != damage && damage <= 0)
|
||||||
|
{ // Still allow FORCEPAIN
|
||||||
|
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
|
||||||
|
goto dopain;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & DMG_NO_FACTOR))
|
if (!(flags & DMG_NO_FACTOR))
|
||||||
{
|
{
|
||||||
damage = FixedMul(damage, target->DamageFactor);
|
damage = FixedMul(damage, target->DamageFactor);
|
||||||
if (damage < 0)
|
if (damage >= 0)
|
||||||
return;
|
{
|
||||||
damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->ActorInfo->DamageFactors);
|
damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->ActorInfo->DamageFactors);
|
||||||
|
}
|
||||||
if (damage <= 0)
|
if (damage <= 0)
|
||||||
|
{ // Still allow FORCEPAIN
|
||||||
|
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))
|
||||||
|
goto dopain;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
|
damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
|
||||||
|
|
Loading…
Reference in a new issue