mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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.
This commit is contained in:
parent
7f0d9fe432
commit
a02e021730
1 changed files with 10 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue