mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
d79c79e1bc
commit
43b007cdcd
1 changed files with 5 additions and 3 deletions
|
|
@ -3172,20 +3172,22 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
// [+ count × uint32 failedSpellId]
|
||||
const bool dispelTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc");
|
||||
uint32_t dispelSpellId = 0;
|
||||
uint64_t dispelCasterGuid = 0;
|
||||
if (dispelTbcLike) {
|
||||
if (packet.getSize() - packet.getReadPos() < 20) break;
|
||||
/*uint64_t caster =*/ packet.readUInt64();
|
||||
dispelCasterGuid = packet.readUInt64();
|
||||
/*uint64_t victim =*/ packet.readUInt64();
|
||||
dispelSpellId = packet.readUInt32();
|
||||
} else {
|
||||
if (packet.getSize() - packet.getReadPos() < 4) break;
|
||||
dispelSpellId = packet.readUInt32();
|
||||
if (packet.getSize() - packet.getReadPos() < 1) break;
|
||||
/*uint64_t caster =*/ UpdateObjectParser::readPackedGuid(packet);
|
||||
dispelCasterGuid = UpdateObjectParser::readPackedGuid(packet);
|
||||
if (packet.getSize() - packet.getReadPos() < 1) break;
|
||||
/*uint64_t victim =*/ UpdateObjectParser::readPackedGuid(packet);
|
||||
}
|
||||
{
|
||||
// Only show failure to the player who attempted the dispel
|
||||
if (dispelCasterGuid == playerGuid) {
|
||||
loadSpellNameCache();
|
||||
auto it = spellNameCache_.find(dispelSpellId);
|
||||
char buf[128];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue