From ae303f05d8311b91a37069c1bf2bed4f6cd2f1da Mon Sep 17 00:00:00 2001 From: Joao Pasqualini Costa Date: Mon, 13 Nov 2023 13:53:33 -0300 Subject: [PATCH] Fix attached effect looping more than it should. --- src/client/attachedeffect.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/attachedeffect.cpp b/src/client/attachedeffect.cpp index 29f9de94ee..e913788445 100644 --- a/src/client/attachedeffect.cpp +++ b/src/client/attachedeffect.cpp @@ -56,6 +56,10 @@ void AttachedEffect::draw(const Point& dest, bool isOnTop, LightView* lightView) --m_loop; } + if (m_frame == 0 && m_loop == 0) { + return; + } + if (m_shader) g_drawPool.setShaderProgram(m_shader, true); if (m_opacity < 100) g_drawPool.setOpacity(getOpacity(), true); @@ -75,8 +79,10 @@ void AttachedEffect::draw(const Point& dest, bool isOnTop, LightView* lightView) int AttachedEffect::getCurrentAnimationPhase() { - if (m_texture) + if (m_texture) { + m_texture->get(m_frame, m_animationTimer); return m_frame; + } const auto* animator = m_thingType->getIdleAnimator(); if (!animator && m_thingType->isAnimateAlways())