forked from teamnwah/openmw-tes3coop
Fix the creature position glitch
This commit is contained in:
parent
6f747df713
commit
d56906acf7
2 changed files with 6 additions and 3 deletions
|
@ -441,6 +441,8 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
||||||
}
|
}
|
||||||
|
|
||||||
// idle handled last as it can depend on the other states
|
// idle handled last as it can depend on the other states
|
||||||
|
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming update),
|
||||||
|
// the idle animation should be displayed
|
||||||
if ((mUpperBodyState != UpperCharState_Nothing
|
if ((mUpperBodyState != UpperCharState_Nothing
|
||||||
|| mMovementState != CharState_None
|
|| mMovementState != CharState_None
|
||||||
|| mHitState != CharState_None)
|
|| mHitState != CharState_None)
|
||||||
|
|
|
@ -988,7 +988,11 @@ void Animation::resetActiveGroups()
|
||||||
|
|
||||||
AnimStateMap::const_iterator state = mStates.find(mAnimationTimePtr[0]->getAnimName());
|
AnimStateMap::const_iterator state = mStates.find(mAnimationTimePtr[0]->getAnimName());
|
||||||
if(state == mStates.end())
|
if(state == mStates.end())
|
||||||
|
{
|
||||||
|
if (mAccumRoot && mNonAccumRoot)
|
||||||
|
mAccumRoot->setPosition(-mNonAccumRoot->getPosition()*mAccumulate);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const Ogre::SharedPtr<AnimSource> &animsrc = state->second.mSource;
|
const Ogre::SharedPtr<AnimSource> &animsrc = state->second.mSource;
|
||||||
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
||||||
|
@ -1142,9 +1146,6 @@ Ogre::Vector3 Animation::runAnimation(float duration)
|
||||||
|
|
||||||
if(!state.mPlaying && state.mAutoDisable)
|
if(!state.mPlaying && state.mAutoDisable)
|
||||||
{
|
{
|
||||||
if(mNonAccumCtrl && stateiter->first == mAnimationTimePtr[0]->getAnimName())
|
|
||||||
mAccumRoot->setPosition(0.f,0.f,0.f);
|
|
||||||
|
|
||||||
mStates.erase(stateiter++);
|
mStates.erase(stateiter++);
|
||||||
|
|
||||||
resetActiveGroups();
|
resetActiveGroups();
|
||||||
|
|
Loading…
Reference in a new issue