forked from mirror/openmw-tes3mp
Merge pull request #1529 from drummyfish/animfix
Stop character landing animation when turning (issue #4177)
This commit is contained in:
commit
45993d3da2
1 changed files with 26 additions and 12 deletions
|
@ -372,21 +372,29 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState
|
|||
}
|
||||
}
|
||||
|
||||
if(mJumpState == JumpState_InAir)
|
||||
{
|
||||
mAnimation->disable(mCurrentJump);
|
||||
mCurrentJump = jumpAnimName;
|
||||
if (mAnimation->hasAnimation("jump"))
|
||||
mAnimation->play(mCurrentJump, Priority_Jump, jumpmask, false,
|
||||
1.0f, (startAtLoop?"loop start":"start"), "stop", 0.0f, ~0ul);
|
||||
}
|
||||
else
|
||||
if (!mCurrentJump.empty())
|
||||
{
|
||||
mAnimation->disable(mCurrentJump);
|
||||
mCurrentJump.clear();
|
||||
if (mAnimation->hasAnimation("jump"))
|
||||
}
|
||||
|
||||
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 if (mJumpState == JumpState_Landing)
|
||||
{
|
||||
if (mAnimation->hasAnimation(jumpAnimName))
|
||||
{
|
||||
mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, true,
|
||||
1.0f, "loop stop", "stop", 0.0f, 0);
|
||||
mCurrentJump = jumpAnimName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1692,7 +1700,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())
|
||||
{
|
||||
|
@ -1847,7 +1854,8 @@ void CharacterController::update(float duration)
|
|||
}
|
||||
else
|
||||
{
|
||||
jumpstate = JumpState_None;
|
||||
jumpstate = mAnimation->isPlaying(mCurrentJump) ? JumpState_Landing : JumpState_None;
|
||||
|
||||
vec.z() = 0.0f;
|
||||
|
||||
inJump = false;
|
||||
|
@ -1877,9 +1885,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…
Reference in a new issue