From 55895340e9c03fdb8a27bdd14767ebab57417081 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 09:25:58 -0700 Subject: [PATCH] game: connect emote animation callback to creature/player renderers SMSG_EMOTE packets for NPCs and other players were received but the emoteAnimCallback_ was never wired to the rendering layer. Register the callback in application.cpp so that when the server sends an emote animation ID, the corresponding CharacterRenderer instance plays it as a one-shot animation (loop=false), falling back to idle on completion. Lookups check creatureInstances_ first, then playerInstances_ so both NPCs and other online players respond to server emote packets. --- src/core/application.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/core/application.cpp b/src/core/application.cpp index 11a5063f..2493d4a4 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2741,6 +2741,27 @@ void Application::setupUICallbacks() { } }); + // Emote animation callback — play server-driven emote animations on NPCs and other players + gameHandler->setEmoteAnimCallback([this](uint64_t guid, uint32_t emoteAnim) { + if (!renderer || emoteAnim == 0) return; + auto* cr = renderer->getCharacterRenderer(); + if (!cr) return; + // Look up creature instance first, then online players + { + auto it = creatureInstances_.find(guid); + if (it != creatureInstances_.end()) { + cr->playAnimation(it->second, emoteAnim, false); + return; + } + } + { + auto it = playerInstances_.find(guid); + if (it != playerInstances_.end()) { + cr->playAnimation(it->second, emoteAnim, false); + } + } + }); + // NPC greeting callback - play voice line gameHandler->setNpcGreetingCallback([this](uint64_t guid, const glm::vec3& position) { if (renderer && renderer->getNpcVoiceManager()) {