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.
This commit is contained in:
Kelsi 2026-03-10 09:25:58 -07:00
parent b2dccca58c
commit 55895340e9

View file

@ -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()) {