From ae6c2aa056737e5be41262320a3ebe53d6436351 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 02:57:05 -0700 Subject: [PATCH] fix: correct SMSG_SPELLDISPELLOG entry size from 8 to 5 bytes Each dispelled spell entry is uint32(spellId) + uint8(isPositive) = 5 bytes, not uint32 + uint32 = 8 bytes as the loop previously assumed. The incorrect stride caused the second and subsequent entries to be read at wrong offsets, potentially showing the wrong spell name for multi-dispels. --- src/game/game_handler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index d6c6dcad..b6c0cd64 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -5267,10 +5267,11 @@ void GameHandler::handlePacket(network::Packet& packet) { if (victimGuid == playerGuid || casterGuid == playerGuid) { const char* verb = isStolen ? "stolen" : "dispelled"; // Collect first dispelled spell name for the message + // Each entry: uint32 spellId + uint8 isPositive (5 bytes in WotLK/TBC/Classic) std::string firstSpellName; - for (uint32_t i = 0; i < count && packet.getSize() - packet.getReadPos() >= 8; ++i) { + for (uint32_t i = 0; i < count && packet.getSize() - packet.getReadPos() >= 5; ++i) { uint32_t dispelledId = packet.readUInt32(); - /*uint32_t unk =*/ packet.readUInt32(); + /*uint8_t isPositive =*/ packet.readUInt8(); if (i == 0) { const std::string& nm = getSpellName(dispelledId); firstSpellName = nm.empty() ? ("spell " + std::to_string(dispelledId)) : nm;