[Client] Fix synchronization of knockdown states

pull/473/head
David Cernat 6 years ago
parent 490303dc0b
commit 33a0886790

@ -498,20 +498,31 @@ namespace MWClass
/* /*
Start of tes3mp change (major) Start of tes3mp change (major)
If the attacker is a DedicatedPlayer or DedicatedActor with a successful knockdown, apply the knockdown; If the attacker is a DedicatedPlayer or DedicatedActor with a successful knockdown, apply the knockdown
otherwise, use default probability roll
If the attacker is neither of those, then it must be a LocalPlayer or a LocalActor, so calculate the
knockdown probability on our client
Default to hit recovery if no knockdown has taken place, like in regular OpenMW
*/ */
mwmp::Attack *dedicatedAttack = MechanicsHelper::getDedicatedAttack(attacker); mwmp::Attack *dedicatedAttack = MechanicsHelper::getDedicatedAttack(attacker);
if (dedicatedAttack && dedicatedAttack->knockdown) if (dedicatedAttack)
{
if (dedicatedAttack->knockdown)
stats.setKnockedDown(true);
}
else
{
if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99())
stats.setKnockedDown(true); stats.setKnockedDown(true);
else if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99()) }
if (!stats.getKnockedDown())
stats.setHitRecovery(true); // Is this supposed to always occur?
/* /*
End of tes3mp change (major) End of tes3mp change (major)
*/ */
stats.setKnockedDown(true);
else
stats.setHitRecovery(true); // Is this supposed to always occur?
} }
damage = std::max(1.f, damage); damage = std::max(1.f, damage);

@ -837,20 +837,31 @@ namespace MWClass
/* /*
Start of tes3mp change (major) Start of tes3mp change (major)
If the attacker is a DedicatedPlayer or DedicatedActor with a successful knockdown, apply the knockdown; If the attacker is a DedicatedPlayer or DedicatedActor with a successful knockdown, apply the knockdown
otherwise, use default probability roll
If the attacker is neither of those, then it must be a LocalPlayer or a LocalActor, so calculate the
knockdown probability on our client
Default to hit recovery if no knockdown has taken place, like in regular OpenMW
*/ */
mwmp::Attack *dedicatedAttack = MechanicsHelper::getDedicatedAttack(attacker); mwmp::Attack *dedicatedAttack = MechanicsHelper::getDedicatedAttack(attacker);
if (dedicatedAttack && dedicatedAttack->knockdown) if (dedicatedAttack)
{
if (dedicatedAttack->knockdown)
stats.setKnockedDown(true);
}
else
{
if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99())
stats.setKnockedDown(true); stats.setKnockedDown(true);
else if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99()) }
if (!stats.getKnockedDown())
stats.setHitRecovery(true); // Is this supposed to always occur?
/* /*
End of tes3mp change (major) End of tes3mp change (major)
*/ */
stats.setKnockedDown(true);
else
stats.setHitRecovery(true); // Is this supposed to always occur?
if (damage > 0 && ishealth) if (damage > 0 && ishealth)
{ {

Loading…
Cancel
Save