mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Merge pull request #1355 from Allofich/animation
Fix problem with animations not looping
This commit is contained in:
commit
a9b17d73dc
1 changed files with 7 additions and 8 deletions
|
@ -2043,13 +2043,13 @@ bool CharacterController::playGroup(const std::string &groupname, int mode, int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If the given animation is a looped animation, is already playing
|
// If this animation is a looped animation (has a "loop start" key) that is already playing
|
||||||
// and has not yet reached its Loop Stop key, make it the only animation
|
// and has not yet reached the end of the loop, allow it to continue animating with its existing loop count
|
||||||
// in the queue, and retain the loop count from the animation that was
|
// and remove any other animations that were queued.
|
||||||
// already playing. This emulates observed behavior from the original
|
// This emulates observed behavior from the original allows the script "OutsideBanner" to animate banners correctly.
|
||||||
// engine and allows banners to animate correctly.
|
|
||||||
if (!mAnimQueue.empty() && mAnimQueue.front().mGroup == groupname &&
|
if (!mAnimQueue.empty() && mAnimQueue.front().mGroup == groupname &&
|
||||||
mAnimation->getTextKeyTime(mAnimQueue.front().mGroup+": loop start") >= 0)
|
mAnimation->getTextKeyTime(mAnimQueue.front().mGroup + ": loop start") >= 0 &&
|
||||||
|
mAnimation->isPlaying(groupname))
|
||||||
{
|
{
|
||||||
float endOfLoop = mAnimation->getTextKeyTime(mAnimQueue.front().mGroup+": loop stop");
|
float endOfLoop = mAnimation->getTextKeyTime(mAnimQueue.front().mGroup+": loop stop");
|
||||||
|
|
||||||
|
@ -2058,7 +2058,6 @@ bool CharacterController::playGroup(const std::string &groupname, int mode, int
|
||||||
|
|
||||||
if (endOfLoop > 0 && (mAnimation->getCurrentTime(mAnimQueue.front().mGroup) < endOfLoop))
|
if (endOfLoop > 0 && (mAnimation->getCurrentTime(mAnimQueue.front().mGroup) < endOfLoop))
|
||||||
{
|
{
|
||||||
mAnimation->setLoopingEnabled(mAnimQueue.front().mGroup, true);
|
|
||||||
mAnimQueue.resize(1);
|
mAnimQueue.resize(1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue