fix: only show SMSG_DISPEL_FAILED message when player is the caster

The dispel-failed handler was showing the failure notification for every
dispel attempt in the party/raid, regardless of who cast it. Now checks
casterGuid == playerGuid before showing "X failed to dispel." so only
the player's own failed dispels surface in chat.
This commit is contained in:
Kelsi 2026-03-13 06:21:33 -07:00
parent d79c79e1bc
commit 43b007cdcd

View file

@ -3172,20 +3172,22 @@ void GameHandler::handlePacket(network::Packet& packet) {
// [+ count × uint32 failedSpellId] // [+ count × uint32 failedSpellId]
const bool dispelTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc"); const bool dispelTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc");
uint32_t dispelSpellId = 0; uint32_t dispelSpellId = 0;
uint64_t dispelCasterGuid = 0;
if (dispelTbcLike) { if (dispelTbcLike) {
if (packet.getSize() - packet.getReadPos() < 20) break; if (packet.getSize() - packet.getReadPos() < 20) break;
/*uint64_t caster =*/ packet.readUInt64(); dispelCasterGuid = packet.readUInt64();
/*uint64_t victim =*/ packet.readUInt64(); /*uint64_t victim =*/ packet.readUInt64();
dispelSpellId = packet.readUInt32(); dispelSpellId = packet.readUInt32();
} else { } else {
if (packet.getSize() - packet.getReadPos() < 4) break; if (packet.getSize() - packet.getReadPos() < 4) break;
dispelSpellId = packet.readUInt32(); dispelSpellId = packet.readUInt32();
if (packet.getSize() - packet.getReadPos() < 1) break; if (packet.getSize() - packet.getReadPos() < 1) break;
/*uint64_t caster =*/ UpdateObjectParser::readPackedGuid(packet); dispelCasterGuid = UpdateObjectParser::readPackedGuid(packet);
if (packet.getSize() - packet.getReadPos() < 1) break; if (packet.getSize() - packet.getReadPos() < 1) break;
/*uint64_t victim =*/ UpdateObjectParser::readPackedGuid(packet); /*uint64_t victim =*/ UpdateObjectParser::readPackedGuid(packet);
} }
{ // Only show failure to the player who attempted the dispel
if (dispelCasterGuid == playerGuid) {
loadSpellNameCache(); loadSpellNameCache();
auto it = spellNameCache_.find(dispelSpellId); auto it = spellNameCache_.find(dispelSpellId);
char buf[128]; char buf[128];