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