1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 21:23:54 +00:00

Don't clear the last queued animation when it stops

This commit is contained in:
Chris Robinson 2013-05-15 06:32:20 -07:00
parent 66f55b3178
commit e069215583

View file

@ -220,12 +220,13 @@ void CharacterController::update(float duration, Movement &movement)
if(!cls.isActor())
{
if(mAnimQueue.size() > 0)
if(mAnimQueue.size() > 1)
{
if(mAnimation->isPlaying(mAnimQueue.front().first) == false)
{
mAnimation->disable(mAnimQueue.front().first);
mAnimQueue.pop_front();
if(mAnimQueue.size() > 0)
mAnimation->play(mAnimQueue.front().first, Priority_Default,
MWRender::Animation::Group_All, false,
"start", "stop", 0.0f, mAnimQueue.front().second);
@ -321,17 +322,21 @@ void CharacterController::update(float duration, Movement &movement)
setState(CharState_TurnLeft);
}
else if(mAnimQueue.size() > 0)
{
if(mAnimQueue.size() > 1)
{
if(mAnimation->isPlaying(mAnimQueue.front().first) == false)
{
mAnimation->disable(mAnimQueue.front().first);
mAnimQueue.pop_front();
if(mAnimQueue.size() > 0)
mAnimation->play(mAnimQueue.front().first, Priority_Default,
MWRender::Animation::Group_All, false,
"start", "stop", 0.0f, mAnimQueue.front().second);
}
}
else if(getState() != CharState_SpecialIdle)
}
else
setState((inwater ? CharState_IdleSwim : (sneak ? CharState_IdleSneak : CharState_Idle)));
vec *= duration;
@ -471,6 +476,8 @@ void CharacterController::playGroup(const std::string &groupname, int mode, int
count = std::max(count, 1);
if(mode != 0 || mAnimQueue.size() == 0)
{
if(mAnimQueue.size() > 0)
mAnimation->disable(mAnimQueue.front().first);
mAnimQueue.clear();
mAnimQueue.push_back(std::make_pair(groupname, count-1));
@ -506,6 +513,8 @@ void CharacterController::forceStateUpdate()
{
if(!mAnimation)
return;
if(mAnimQueue.size() > 0)
mAnimation->disable(mAnimQueue.front().first);
mAnimQueue.clear();
std::string group;