Don't apply falling damage twice (bug #4608)

pull/1900/head
Capostrophic 6 years ago
parent c280a71b33
commit 23834b5ed8

@ -107,6 +107,7 @@
Bug #4597: <> operator causes a compile error
Bug #4604: Picking up gold from the ground only makes 1 grabbed
Bug #4607: Scaling for animated collision shapes is applied twice
Bug #4608: Falling damage is applied twice
Bug #4615: Flicker effects for light sources are handled incorrectly
Bug #4617: First person sneaking offset is not applied while the character is in air
Bug #4618: Sneaking is possible while the character is flying

@ -2012,10 +2012,7 @@ void CharacterController::update(float duration)
// inflict fall damages
if (!godmode)
{
DynamicStat<float> health = cls.getCreatureStats(mPtr).getHealth();
float realHealthLost = static_cast<float>(healthLost * (1.0f - 0.25f * fatigueTerm));
health.setCurrent(health.getCurrent() - realHealthLost);
cls.getCreatureStats(mPtr).setHealth(health);
cls.onHit(mPtr, realHealthLost, true, MWWorld::Ptr(), MWWorld::Ptr(), osg::Vec3f(), true);
}

Loading…
Cancel
Save