From 2f4cd6b713fbb5abfd701110ba5dd247c3bb347a Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 26 Dec 2017 19:27:13 +0200 Subject: [PATCH] [Client] Revert "Merge pull request #1529 from drummyfish/animfix" This reverts commit 45993d3da21105879507772f53a9a25baaf54795, reversing changes made to 3d347730dcdfacb4a9e63b5bbad060abc3c438d8. That commit made players have to wait around 1.5 seconds after each jump before doing a new one. It will be reinstated once its accompanying OpenMW issue at https://bugs.openmw.org/issues/4250 is fixed. --- apps/openmw/mwmechanics/character.cpp | 34 ++++++++------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 6e6570b00..fbcb7371a 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -390,29 +390,21 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState } } - if (!mCurrentJump.empty()) - { - mAnimation->disable(mCurrentJump); - mCurrentJump.clear(); - } - if(mJumpState == JumpState_InAir) { - if (mAnimation->hasAnimation(jumpAnimName)) - { - mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, false, + 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); - mCurrentJump = jumpAnimName; - } } - else if (mJumpState == JumpState_Landing) + else { - if (mAnimation->hasAnimation(jumpAnimName)) - { + mAnimation->disable(mCurrentJump); + mCurrentJump.clear(); + if (mAnimation->hasAnimation("jump")) mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, true, 1.0f, "loop stop", "stop", 0.0f, 0); - mCurrentJump = jumpAnimName; - } } } } @@ -1833,6 +1825,7 @@ 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()) { @@ -1987,8 +1980,7 @@ void CharacterController::update(float duration) } else { - jumpstate = mAnimation->isPlaying(mCurrentJump) ? JumpState_Landing : JumpState_None; - + jumpstate = JumpState_None; vec.z() = 0.0f; inJump = false; @@ -2018,15 +2010,9 @@ 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); - } } }