mirror of
https://github.com/minetest/minetest.git
synced 2024-09-19 23:10:46 +03:00
Fix animations not being restartable (#15016)
Some checks failed
android / build (push) Has been cancelled
cpp_lint / clang_tidy (push) Has been cancelled
linux / gcc_7 (push) Has been cancelled
linux / gcc_14 (push) Has been cancelled
linux / clang_7 (push) Has been cancelled
linux / clang_18 (push) Has been cancelled
linux / clang_11 (PROMETHEUS=1) (push) Has been cancelled
lua_api_deploy / build (push) Has been cancelled
macos / build (push) Has been cancelled
whitespace_checks / trailing_whitespaces (push) Has been cancelled
whitespace_checks / tabs_lua_api_files (push) Has been cancelled
windows / MinGW cross-compiler (${{ matrix.bits }}-bit) (32) (push) Has been cancelled
windows / MinGW cross-compiler (${{ matrix.bits }}-bit) (64) (push) Has been cancelled
windows / VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} (map[arch:x64 generator:-G'Visual Studio 16 2019' -A x64 vcpkg_triplet:x64-windows], portable) (push) Has been cancelled
windows / VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} (map[arch:x86 generator:-G'Visual Studio 16 2019' -A Win32 vcpkg_triplet:x86-windows], portable) (push) Has been cancelled
Some checks failed
android / build (push) Has been cancelled
cpp_lint / clang_tidy (push) Has been cancelled
linux / gcc_7 (push) Has been cancelled
linux / gcc_14 (push) Has been cancelled
linux / clang_7 (push) Has been cancelled
linux / clang_18 (push) Has been cancelled
linux / clang_11 (PROMETHEUS=1) (push) Has been cancelled
lua_api_deploy / build (push) Has been cancelled
macos / build (push) Has been cancelled
whitespace_checks / trailing_whitespaces (push) Has been cancelled
whitespace_checks / tabs_lua_api_files (push) Has been cancelled
windows / MinGW cross-compiler (${{ matrix.bits }}-bit) (32) (push) Has been cancelled
windows / MinGW cross-compiler (${{ matrix.bits }}-bit) (64) (push) Has been cancelled
windows / VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} (map[arch:x64 generator:-G'Visual Studio 16 2019' -A x64 vcpkg_triplet:x64-windows], portable) (push) Has been cancelled
windows / VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} (map[arch:x86 generator:-G'Visual Studio 16 2019' -A Win32 vcpkg_triplet:x86-windows], portable) (push) Has been cancelled
This commit is contained in:
parent
2664afd832
commit
dc21924f31
@ -1518,9 +1518,8 @@ void GenericCAO::updateAnimation()
|
|||||||
if (!m_animated_meshnode)
|
if (!m_animated_meshnode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_animated_meshnode->getStartFrame() != m_animation_range.X ||
|
// Note: This sets the current frame as well, (re)starting the animation.
|
||||||
m_animated_meshnode->getEndFrame() != m_animation_range.Y)
|
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
|
||||||
m_animated_meshnode->setFrameLoop(m_animation_range.X, m_animation_range.Y);
|
|
||||||
if (m_animated_meshnode->getAnimationSpeed() != m_animation_speed)
|
if (m_animated_meshnode->getAnimationSpeed() != m_animation_speed)
|
||||||
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
|
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
|
||||||
m_animated_meshnode->setTransitionTime(m_animation_blend);
|
m_animated_meshnode->setTransitionTime(m_animation_blend);
|
||||||
|
@ -55,10 +55,7 @@ const ItemGroupList &UnitSAO::getArmorGroups() const
|
|||||||
void UnitSAO::setAnimation(
|
void UnitSAO::setAnimation(
|
||||||
v2f frame_range, float frame_speed, float frame_blend, bool frame_loop)
|
v2f frame_range, float frame_speed, float frame_blend, bool frame_loop)
|
||||||
{
|
{
|
||||||
if (std::tie(m_animation_range, m_animation_speed, m_animation_blend,
|
// Note: Always resend (even if parameters are unchanged) to restart animations.
|
||||||
m_animation_loop) ==
|
|
||||||
std::tie(frame_range, frame_speed, frame_blend, frame_loop))
|
|
||||||
return; // no change
|
|
||||||
m_animation_range = frame_range;
|
m_animation_range = frame_range;
|
||||||
m_animation_speed = frame_speed;
|
m_animation_speed = frame_speed;
|
||||||
m_animation_blend = frame_blend;
|
m_animation_blend = frame_blend;
|
||||||
|
Loading…
Reference in New Issue
Block a user