mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
Don't knock down from fall damage in onHit (CharacterController is doing that already)
This commit is contained in:
parent
a731ec3587
commit
accab47724
2 changed files with 14 additions and 11 deletions
|
@ -367,6 +367,8 @@ namespace MWClass
|
||||||
damage = 0;
|
damage = 0;
|
||||||
|
|
||||||
if (damage > 0.f)
|
if (damage > 0.f)
|
||||||
|
{
|
||||||
|
if (!attacker.isEmpty())
|
||||||
{
|
{
|
||||||
// Check for knockdown
|
// Check for knockdown
|
||||||
float agilityTerm = getCreatureStats(ptr).getAttribute(ESM::Attribute::Agility).getModified() * getGmst().fKnockDownMult->getFloat();
|
float agilityTerm = getCreatureStats(ptr).getAttribute(ESM::Attribute::Agility).getModified() * getGmst().fKnockDownMult->getFloat();
|
||||||
|
@ -380,6 +382,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
getCreatureStats(ptr).setHitRecovery(true); // Is this supposed to always occur?
|
getCreatureStats(ptr).setHitRecovery(true); // Is this supposed to always occur?
|
||||||
|
}
|
||||||
|
|
||||||
damage = std::max(1.f, damage);
|
damage = std::max(1.f, damage);
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,7 @@ namespace MWClass
|
||||||
if (damage < 0.001f)
|
if (damage < 0.001f)
|
||||||
damage = 0;
|
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
|
// 'ptr' is losing health. Play a 'hit' voiced dialog entry if not already saying
|
||||||
// something, alert the character controller, scripts, etc.
|
// something, alert the character controller, scripts, etc.
|
||||||
|
@ -700,7 +700,7 @@ namespace MWClass
|
||||||
else
|
else
|
||||||
getCreatureStats(ptr).setHitRecovery(true); // Is this supposed to always occur?
|
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:
|
// Hit percentages:
|
||||||
// cuirass = 30%
|
// cuirass = 30%
|
||||||
|
|
Loading…
Reference in a new issue