From ac9214c03fd7f675f4e3a59ff55261443af73895 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 09:08:02 -0700 Subject: [PATCH] feat: fire UNIT_THREAT_LIST_UPDATE event on threat changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fire UNIT_THREAT_LIST_UPDATE from SMSG_THREAT_UPDATE, SMSG_HIGHEST_THREAT_UPDATE, and SMSG_THREAT_CLEAR. Threat data is already parsed and stored in threatLists_ — this event notifies addon systems when the data changes. Used by Omen, ThreatPlates, and other threat meter addons to refresh their displays when threat values update. --- src/game/game_handler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 27216114..265a4144 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2848,6 +2848,7 @@ void GameHandler::handlePacket(network::Packet& packet) { // All threat dropped on the local player (e.g. Vanish, Feign Death) threatLists_.clear(); LOG_DEBUG("SMSG_THREAT_CLEAR: threat wiped"); + if (addonEventCallback_) addonEventCallback_("UNIT_THREAT_LIST_UPDATE", {}); break; case Opcode::SMSG_THREAT_REMOVE: { // packed_guid (unit) + packed_guid (victim whose threat was removed) @@ -2891,6 +2892,8 @@ void GameHandler::handlePacket(network::Packet& packet) { std::sort(list.begin(), list.end(), [](const ThreatEntry& a, const ThreatEntry& b){ return a.threat > b.threat; }); threatLists_[unitGuid] = std::move(list); + if (addonEventCallback_) + addonEventCallback_("UNIT_THREAT_LIST_UPDATE", {}); break; }