From b3ad64099be36ada31a382259993c09150aacca5 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 06:27:55 -0700 Subject: [PATCH] feat: fire UNIT_PET event when pet is summoned, dismissed, or dies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fire UNIT_PET with "player" as arg from SMSG_PET_SPELLS when: - Pet is cleared (dismissed/dies) — both size-based and guid=0 paths - Pet is summoned (new pet GUID received with spell list) Used by pet frame addons and unit frame addons to show/hide pet frames and update pet action bars when pet state changes. --- 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 0f4ebc18..76fed46c 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -18936,6 +18936,7 @@ void GameHandler::handlePetSpells(network::Packet& packet) { petAutocastSpells_.clear(); memset(petActionSlots_, 0, sizeof(petActionSlots_)); LOG_INFO("SMSG_PET_SPELLS: pet cleared"); + if (addonEventCallback_) addonEventCallback_("UNIT_PET", {"player"}); return; } @@ -18945,6 +18946,7 @@ void GameHandler::handlePetSpells(network::Packet& packet) { petAutocastSpells_.clear(); memset(petActionSlots_, 0, sizeof(petActionSlots_)); LOG_INFO("SMSG_PET_SPELLS: pet cleared (guid=0)"); + if (addonEventCallback_) addonEventCallback_("UNIT_PET", {"player"}); return; } @@ -18986,6 +18988,7 @@ 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"}); } void GameHandler::sendPetAction(uint32_t action, uint64_t targetGuid) {