mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
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:
parent
60b93cdfd9
commit
c20d7c2638
1 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue