[Client] Reinstate "Merge pull request #1529 from drummyfish/animfix"

This reverts commit 2f4cd6b713 and adds back the changes made by 45993d3da2 because the OpenMW issue at https://bugs.openmw.org/issues/4250 has been fixed by 57257d057f
0.6.2
David Cernat 7 years ago
parent 47a3dc9ff2
commit bca9c55046

@ -390,21 +390,29 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState
}
}
if(mJumpState == JumpState_InAir)
if (!mCurrentJump.empty())
{
mAnimation->disable(mCurrentJump);
mCurrentJump = jumpAnimName;
if (mAnimation->hasAnimation("jump"))
mAnimation->play(mCurrentJump, Priority_Jump, jumpmask, false,
mCurrentJump.clear();
}
if(mJumpState == JumpState_InAir)
{
if (mAnimation->hasAnimation(jumpAnimName))
{
mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, false,
1.0f, (startAtLoop?"loop start":"start"), "stop", 0.0f, ~0ul);
mCurrentJump = jumpAnimName;
}
}
else
else if (mJumpState == JumpState_Landing)
{
mAnimation->disable(mCurrentJump);
mCurrentJump.clear();
if (mAnimation->hasAnimation("jump"))
if (mAnimation->hasAnimation(jumpAnimName))
{
mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, true,
1.0f, "loop stop", "stop", 0.0f, 0);
mCurrentJump = jumpAnimName;
}
}
}
}
@ -1825,7 +1833,6 @@ void CharacterController::update(float duration)
mHasMovedInXY = std::abs(vec.x())+std::abs(vec.y()) > 0.0f;
isrunning = isrunning && mHasMovedInXY;
// advance athletics
if(mHasMovedInXY && mPtr == getPlayer())
{
@ -1980,7 +1987,8 @@ void CharacterController::update(float duration)
}
else
{
jumpstate = JumpState_None;
jumpstate = mAnimation->isPlaying(mCurrentJump) ? JumpState_Landing : JumpState_None;
vec.z() = 0.0f;
inJump = false;
@ -2010,9 +2018,15 @@ void CharacterController::update(float duration)
else if(rot.z() != 0.0f && !sneak && !(mPtr == getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson()))
{
if(rot.z() > 0.0f)
{
movestate = inwater ? CharState_SwimTurnRight : CharState_TurnRight;
mAnimation->disable(mCurrentJump);
}
else if(rot.z() < 0.0f)
{
movestate = inwater ? CharState_SwimTurnLeft : CharState_TurnLeft;
mAnimation->disable(mCurrentJump);
}
}
}

Loading…
Cancel
Save