Skip to content

Commit

Permalink
Fix attached effect looping more than it should.
Browse files Browse the repository at this point in the history
  • Loading branch information
conde2 committed Nov 13, 2023
1 parent 7da55d9 commit ae303f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/attachedeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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())
Expand Down

0 comments on commit ae303f0

Please sign in to comment.