mirror of https://github.com/minetest/minetest.git
Format PR #4207
This commit is contained in:
parent
aa8b64cb2d
commit
bc1ea1684f
|
@ -1491,15 +1491,14 @@ void GenericCAO::updateAnimation()
|
|||
return;
|
||||
|
||||
if (m_animated_meshnode->getStartFrame() != m_animation_range.X ||
|
||||
m_animated_meshnode->getEndFrame() != m_animation_range.Y)
|
||||
{
|
||||
f32 current_frame = m_animated_meshnode->getFrameNr();
|
||||
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
|
||||
// setFrameLoop method has a side effect, it resets the current frame of the animation
|
||||
if (current_frame > m_animated_meshnode->getStartFrame() &&
|
||||
current_frame < m_animated_meshnode->getEndFrame())
|
||||
m_animated_meshnode->setCurrentFrame(current_frame);
|
||||
}
|
||||
m_animated_meshnode->getEndFrame() != m_animation_range.Y) {
|
||||
f32 current_frame = m_animated_meshnode->getFrameNr();
|
||||
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
|
||||
// setFrameLoop method has a side effect, it resets the current frame of the animation
|
||||
if (current_frame > m_animated_meshnode->getStartFrame() &&
|
||||
current_frame < m_animated_meshnode->getEndFrame())
|
||||
m_animated_meshnode->setCurrentFrame(current_frame);
|
||||
}
|
||||
if (m_animated_meshnode->getAnimationSpeed() != m_animation_speed)
|
||||
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
|
||||
m_animated_meshnode->setTransitionTime(m_animation_blend);
|
||||
|
|
Loading…
Reference in New Issue