rendering: return to Stand after one-shot emote animations complete

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.
This commit is contained in:
Kelsi 2026-03-10 09:36:58 -07:00
parent 60b93cdfd9
commit c20d7c2638

View file

@ -1659,7 +1659,13 @@ void CharacterRenderer::update(float deltaTime, const glm::vec3& cameraPos) {
if (inst.animationLoop) {
inst.animationTime = std::fmod(inst.animationTime, static_cast<float>(seq.duration));
} else {
inst.animationTime = static_cast<float>(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<float>(seq.duration);
}
}
}
}