From 8f2a2dfbb4068a59a0160ccbedbf60ac6beaf859 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 02:58:55 -0700 Subject: [PATCH] feat: fire UNIT_NAME_UPDATE event when player names are resolved Fire UNIT_NAME_UPDATE for target/focus/player when SMSG_NAME_QUERY_RESPONSE resolves a player's name. Nameplate and unit frame addons use this event to update displayed names when they become available asynchronously. --- src/game/game_handler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index cf25f82b..757cc379 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -14841,6 +14841,16 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) { if (friendGuids_.count(data.guid)) { friendsCache[data.name] = data.guid; } + + // Fire UNIT_NAME_UPDATE so nameplate/unit frame addons know the name is available + if (addonEventCallback_) { + std::string unitId; + if (data.guid == targetGuid) unitId = "target"; + else if (data.guid == focusGuid) unitId = "focus"; + else if (data.guid == playerGuid) unitId = "player"; + if (!unitId.empty()) + addonEventCallback_("UNIT_NAME_UPDATE", {unitId}); + } } }