Do not play same animation twice

This commit is contained in:
Vsevolod Kremianskii 2021-05-15 16:07:29 +07:00
parent 5ff803f0aa
commit 91643240fd

View file

@ -43,6 +43,10 @@ void ModelSceneNode::playAnimation(shared_ptr<Animation> anim, shared_ptr<LipAni
if (properties.scale == 0.0f) {
properties.scale = _model->animationScale();
}
// Return if same animation is already playing
if (!_animChannels.empty() && _animChannels[0].anim == anim && _animChannels[0].lipAnim == lipAnim && _animChannels[0].properties == properties) return;
AnimationBlendMode blendMode = getAnimationBlendMode(properties.flags);
switch (blendMode) {