Stop idle animations for non-biped creatures when attacking/moving

The idle animation wouldn't be visible anyway, since these creatures don't have animation layers. However sounds tagged in the animation would still play.
moveref
scrawl 10 years ago
parent a58bc9f2f7
commit 6c9875969a

@ -1384,4 +1384,9 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
return ref->mBase->mAiData.mFight;
}
bool Npc::isBipedal(const MWWorld::Ptr &ptr) const
{
return true;
}
}

@ -182,6 +182,8 @@ namespace MWClass
return true;
}
virtual bool isBipedal (const MWWorld::Ptr &ptr) const;
virtual void respawn (const MWWorld::Ptr& ptr) const;
virtual void restock (const MWWorld::Ptr& ptr) const;

@ -1586,7 +1586,14 @@ void CharacterController::update(float duration)
clearAnimQueue();
if(mAnimQueue.empty())
{
idlestate = (inwater ? CharState_IdleSwim : (sneak ? CharState_IdleSneak : CharState_Idle));
if ((mUpperBodyState != UpperCharState_Nothing
|| mMovementState != CharState_None
|| mHitState != CharState_None)
&& !mPtr.getClass().isBipedal(mPtr))
idlestate = CharState_None;
}
else if(mAnimQueue.size() > 1)
{
if(mAnimation->isPlaying(mAnimQueue.front().first) == false)

Loading…
Cancel
Save