From c6a6849c8691c7c8e089d0e9d53757539d3b1ff7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 07:30:01 -0700 Subject: [PATCH] feat: fire PET_BAR_UPDATE event when pet action bar changes Fire PET_BAR_UPDATE when: - Pet is summoned (SMSG_PET_SPELLS with new spell list) - Pet learns a new spell (SMSG_PET_LEARNED_SPELL) Used by pet action bar addons to refresh their display when the pet's available abilities change. --- src/game/game_handler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0b025bcb..7f5da2c2 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -7993,6 +7993,7 @@ void GameHandler::handlePacket(network::Packet& packet) { const std::string& sname = getSpellName(spellId); addSystemChatMessage("Your pet has learned " + (sname.empty() ? "a new ability." : sname + ".")); LOG_DEBUG("SMSG_PET_LEARNED_SPELL: spellId=", spellId); + if (addonEventCallback_) addonEventCallback_("PET_BAR_UPDATE", {}); } packet.setReadPos(packet.getSize()); break; @@ -19017,7 +19018,10 @@ done: LOG_INFO("SMSG_PET_SPELLS: petGuid=0x", std::hex, petGuid_, std::dec, " react=", (int)petReact_, " command=", (int)petCommand_, " spells=", petSpellList_.size()); - if (addonEventCallback_) addonEventCallback_("UNIT_PET", {"player"}); + if (addonEventCallback_) { + addonEventCallback_("UNIT_PET", {"player"}); + addonEventCallback_("PET_BAR_UPDATE", {}); + } } void GameHandler::sendPetAction(uint32_t action, uint64_t targetGuid) {