From c20d7c26383902ea63f28d3361b08a8d8a8a0d11 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 09:36:58 -0700 Subject: [PATCH] rendering: return to Stand after one-shot emote animations complete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a non-looping animation (e.g. wave, cheer, laugh emote) reaches its end, transition back to Stand (animation 0) rather than freezing on the last frame. Death (animation 1) is excluded — it stays on the final frame as expected. Fixes NPCs and players getting stuck in emote poses after SMSG_EMOTE. --- src/rendering/character_renderer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rendering/character_renderer.cpp b/src/rendering/character_renderer.cpp index c8fbdc79..c16fc99c 100644 --- a/src/rendering/character_renderer.cpp +++ b/src/rendering/character_renderer.cpp @@ -1659,7 +1659,13 @@ void CharacterRenderer::update(float deltaTime, const glm::vec3& cameraPos) { if (inst.animationLoop) { inst.animationTime = std::fmod(inst.animationTime, static_cast(seq.duration)); } else { - inst.animationTime = static_cast(seq.duration); + // One-shot animation finished: return to Stand (0) unless dead + if (inst.currentAnimationId != 1 /*Death*/) { + playAnimation(pair.first, 0, true); + } else { + // Stay on last frame of death + inst.animationTime = static_cast(seq.duration); + } } } }