From a02e021730bd51ee0a5d1f3d2a9e35039547ac08 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 05:22:17 -0700 Subject: [PATCH] fix: fire UNIT_SPELLCAST_FAILED/STOP for other units on SPELL_FAILED_OTHER SMSG_SPELL_FAILED_OTHER was clearing the unit cast state but not firing addon events. Cast bar addons (Quartz, ClassicCastbars) showing target/ focus cast bars need UNIT_SPELLCAST_FAILED and UNIT_SPELLCAST_STOP to clear the bar when another unit's cast fails. Now fires both events for target and focus units, matching the behavior already implemented for the player's own cast failures. --- 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 41c2f665..a4ab783d 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2344,6 +2344,16 @@ void GameHandler::handlePacket(network::Packet& packet) { : UpdateObjectParser::readPackedGuid(packet); if (failOtherGuid != 0 && failOtherGuid != playerGuid) { unitCastStates_.erase(failOtherGuid); + // Fire cast failure events so cast bar addons clear the bar + if (addonEventCallback_) { + std::string unitId; + if (failOtherGuid == targetGuid) unitId = "target"; + else if (failOtherGuid == focusGuid) unitId = "focus"; + if (!unitId.empty()) { + addonEventCallback_("UNIT_SPELLCAST_FAILED", {unitId}); + addonEventCallback_("UNIT_SPELLCAST_STOP", {unitId}); + } + } } packet.setReadPos(packet.getSize()); break;