diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index d4df471e7..068929ce6 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2127,9 +2127,6 @@ void CharacterController::update(float duration) movementSettings.mPosition[2] = onground ? 1 : 0; } - osg::Vec3f rot = cls.getRotationVector(mPtr); - osg::Vec3f vec(movementSettings.asVec3()); - /* Start of tes3mp addition @@ -2162,6 +2159,9 @@ void CharacterController::update(float duration) End of tes3mp addition */ + osg::Vec3f rot = cls.getRotationVector(mPtr); + osg::Vec3f vec(movementSettings.asVec3()); + movementSettings.mSpeedFactor = std::min(vec.length(), 1.f); vec.normalize();