mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 20:09:40 +00:00
Keep track of the animation group currently playing
This commit is contained in:
parent
4dd01b81c6
commit
afbc9f3e41
2 changed files with 9 additions and 4 deletions
|
@ -41,10 +41,12 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
|||
switch(mState)
|
||||
{
|
||||
case CharState_Idle:
|
||||
mAnimation->playGroup("idle", 1, 1);
|
||||
mCurrentGroup = "idle";
|
||||
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||
break;
|
||||
case CharState_Dead:
|
||||
mAnimation->playGroup("death1", 1, 1);
|
||||
mCurrentGroup = "death1";
|
||||
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -100,10 +102,12 @@ void CharacterController::setState(CharacterState state)
|
|||
switch(mState)
|
||||
{
|
||||
case CharState_Idle:
|
||||
mAnimation->playGroup("idle", 1, 1);
|
||||
mCurrentGroup = "idle";
|
||||
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||
break;
|
||||
case CharState_Dead:
|
||||
mAnimation->playGroup("death1", 1, 1);
|
||||
mCurrentGroup = "death1";
|
||||
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class CharacterController
|
|||
MWWorld::Ptr mPtr;
|
||||
MWRender::Animation *mAnimation;
|
||||
|
||||
std::string mCurrentGroup;
|
||||
CharacterState mState;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue