mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
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.
This commit is contained in:
parent
a58bc9f2f7
commit
6c9875969a
3 changed files with 14 additions and 0 deletions
|
@ -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…
Reference in a new issue