|
|
|
@ -2070,7 +2070,7 @@ namespace MWMechanics
|
|
|
|
|
vec.x() *= speed;
|
|
|
|
|
vec.y() *= speed;
|
|
|
|
|
|
|
|
|
|
if (isKnockedOut() || isKnockedDown() || isRecovery())
|
|
|
|
|
if (isKnockedOut() || isKnockedDown() || isRecovery() || isScriptedAnimPlaying())
|
|
|
|
|
vec = osg::Vec3f();
|
|
|
|
|
|
|
|
|
|
CharacterState movestate = CharState_None;
|
|
|
|
@ -2144,6 +2144,15 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
bool wasInJump = mInJump;
|
|
|
|
|
mInJump = false;
|
|
|
|
|
const float jumpHeight = cls.getJump(mPtr);
|
|
|
|
|
if (jumpHeight <= 0.f || sneak || inwater || flying || !solid)
|
|
|
|
|
{
|
|
|
|
|
vec.z() = 0.f;
|
|
|
|
|
// Following code might assign some vertical movement regardless, need to reset this manually
|
|
|
|
|
// This is used for jumping detection
|
|
|
|
|
movementSettings.mPosition[2] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!inwater && !flying && solid)
|
|
|
|
|
{
|
|
|
|
|
// In the air (either getting up —ascending part of jump— or falling).
|
|
|
|
@ -2162,20 +2171,16 @@ namespace MWMechanics
|
|
|
|
|
vec.z() = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
// Started a jump.
|
|
|
|
|
else if (mJumpState != JumpState_InAir && vec.z() > 0.f && !sneak)
|
|
|
|
|
{
|
|
|
|
|
float z = cls.getJump(mPtr);
|
|
|
|
|
if (z > 0.f)
|
|
|
|
|
else if (mJumpState != JumpState_InAir && vec.z() > 0.f)
|
|
|
|
|
{
|
|
|
|
|
mInJump = true;
|
|
|
|
|
if (vec.x() == 0 && vec.y() == 0)
|
|
|
|
|
vec.z() = z;
|
|
|
|
|
vec.z() = jumpHeight;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
osg::Vec3f lat(vec.x(), vec.y(), 0.0f);
|
|
|
|
|
lat.normalize();
|
|
|
|
|
vec = osg::Vec3f(lat.x(), lat.y(), 1.0f) * z * 0.707f;
|
|
|
|
|
}
|
|
|
|
|
vec = osg::Vec3f(lat.x(), lat.y(), 1.0f) * jumpHeight * 0.707f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|