From 702155ff4f13d7b98ad0e3bf9aa68a916e04273b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 18 Mar 2026 06:20:18 -0700 Subject: [PATCH] fix: correct SMSG_SPELL_GO REFLECT miss payload size (WotLK/TBC) WotLK and TBC parsers were reading uint32+uint8 (5 bytes) for SPELL_MISS_REFLECT entries, but the server only sends uint8 reflectResult (1 byte). This caused a 4-byte misalignment after every reflected spell, corrupting subsequent miss entries and SpellCastTargets parsing. Classic parser was already correct. --- src/game/packet_parsers_tbc.cpp | 7 +++---- src/game/world_packets.cpp | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/game/packet_parsers_tbc.cpp b/src/game/packet_parsers_tbc.cpp index 8e8fbd25..c1397460 100644 --- a/src/game/packet_parsers_tbc.cpp +++ b/src/game/packet_parsers_tbc.cpp @@ -1403,15 +1403,14 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data) SpellGoMissEntry m; m.targetGuid = packet.readUInt64(); // full GUID in TBC m.missType = packet.readUInt8(); - if (m.missType == 11) { - if (packet.getReadPos() + 5 > packet.getSize()) { + if (m.missType == 11) { // SPELL_MISS_REFLECT + if (packet.getReadPos() + 1 > packet.getSize()) { LOG_WARNING("[TBC] Spell go: truncated reflect payload at miss index ", i, "/", (int)rawMissCount); truncatedTargets = true; break; } - (void)packet.readUInt32(); - (void)packet.readUInt8(); + (void)packet.readUInt8(); // reflectResult } if (i < storedMissLimit) { data.missTargets.push_back(m); diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index 50c1208a..a4562067 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -3912,14 +3912,13 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) { break; } m.missType = packet.readUInt8(); - if (m.missType == 11) { - if (packet.getSize() - packet.getReadPos() < 5) { + if (m.missType == 11) { // SPELL_MISS_REFLECT + if (packet.getSize() - packet.getReadPos() < 1) { LOG_WARNING("Spell go: truncated reflect payload at miss index ", i, "/", (int)rawMissCount); truncatedTargets = true; break; } - (void)packet.readUInt32(); - (void)packet.readUInt8(); + (void)packet.readUInt8(); // reflectResult } if (i < storedMissLimit) { data.missTargets.push_back(m);