From 491dd2b673e370d7b133b724be260ce436597614 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 22 Mar 2026 19:00:34 -0700 Subject: [PATCH] feat: fire SPELL_UPDATE_USABLE alongside ACTIONBAR_UPDATE_USABLE Some addons register for SPELL_UPDATE_USABLE instead of ACTIONBAR_UPDATE_USABLE to detect when spell usability changes due to power fluctuations. Fire both events together when the player's mana/rage/energy changes. --- src/game/game_handler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index e04ee3b4..30848ced 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2201,8 +2201,10 @@ void GameHandler::handlePacket(network::Packet& packet) { else if (guid == petGuid_) unitId = "pet"; if (!unitId.empty()) { addonEventCallback_("UNIT_POWER", {unitId}); - if (guid == playerGuid) + if (guid == playerGuid) { addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {}); + addonEventCallback_("SPELL_UPDATE_USABLE", {}); + } } } break; @@ -12681,8 +12683,10 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem if (powerChanged) { addonEventCallback_("UNIT_POWER", {unitId}); // When player power changes, action bar usability may change - if (block.guid == playerGuid) + if (block.guid == playerGuid) { addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {}); + addonEventCallback_("SPELL_UPDATE_USABLE", {}); + } } } }