From 2abe5c1c9a304bae549d4591f0c11ccd84286c9b Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Wed, 2 Oct 2013 22:54:36 +0200 Subject: [PATCH] Acrobatics: do not apply fall damages when slowfalling spell effect is active If spell effect ends up in mid-air, calculate fall height from then. --- apps/openmw/mwmechanics/character.cpp | 10 +++++++++- apps/openmw/mwmechanics/character.hpp | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 0924e36b9..c4260d907 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -776,7 +776,15 @@ void CharacterController::update(float duration) { // The player is in the air (either getting up —ascending part of jump— or falling). - mFallHeight = std::max(mFallHeight, mPtr.getRefData().getPosition().pos[2]); + if (world->isSlowFalling(mPtr)) + { + // SlowFalling spell effect is active, do not keep previous fall height + mFallHeight = mPtr.getRefData().getPosition().pos[2]; + } + else + { + mFallHeight = std::max(mFallHeight, mPtr.getRefData().getPosition().pos[2]); + } const MWWorld::Store &gmst = world->getStore().get(); diff --git a/apps/openmw/mwmechanics/character.hpp b/apps/openmw/mwmechanics/character.hpp index 7b9dda49a..8670b385e 100644 --- a/apps/openmw/mwmechanics/character.hpp +++ b/apps/openmw/mwmechanics/character.hpp @@ -3,6 +3,8 @@ #include +#include + #include "../mwworld/ptr.hpp" namespace MWWorld