1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-19 10:41:36 +00:00

Don't knock down from fall damage in onHit (CharacterController is doing that already)

This commit is contained in:
scrawl 2014-08-07 19:30:04 +02:00
parent a731ec3587
commit accab47724
2 changed files with 14 additions and 11 deletions

View file

@ -367,6 +367,8 @@ namespace MWClass
damage = 0;
if (damage > 0.f)
{
if (!attacker.isEmpty())
{
// Check for knockdown
float agilityTerm = getCreatureStats(ptr).getAttribute(ESM::Attribute::Agility).getModified() * getGmst().fKnockDownMult->getFloat();
@ -380,6 +382,7 @@ namespace MWClass
}
else
getCreatureStats(ptr).setHitRecovery(true); // Is this supposed to always occur?
}
damage = std::max(1.f, damage);

View file

@ -672,7 +672,7 @@ namespace MWClass
if (damage < 0.001f)
damage = 0;
if(damage > 0.0f)
if(damage > 0.0f && !attacker.isEmpty())
{
// 'ptr' is losing health. Play a 'hit' voiced dialog entry if not already saying
// something, alert the character controller, scripts, etc.
@ -700,7 +700,7 @@ namespace MWClass
else
getCreatureStats(ptr).setHitRecovery(true); // Is this supposed to always occur?
if(damage > 0 && ishealth && !attacker.isEmpty()) // Don't use armor mitigation for fall damage
if(damage > 0 && ishealth)
{
// Hit percentages:
// cuirass = 30%