tbc: fix SMSG_SPELL_START and SMSG_SPELL_GO for TBC 2.4.3

TBC 2.4.3 SMSG_SPELL_START and SMSG_SPELL_GO send full uint64 GUIDs for
casterGuid/casterUnit and hit targets.  WotLK uses packed (variable-length)
GUIDs.  Using readPackedGuid() on a full uint64 reads the first byte as the
bitmask, consuming 1-8 wrong bytes, which shifts all subsequent fields
(spellId, castFlags, castTime) and causes:
  - Cast bar to never show for the player's own spells
  - Sound effects to use the wrong spell ID
  - Hit/miss target tracking to be completely wrong

Additionally, TBC SMSG_SPELL_GO lacks the WotLK timestamp field after
castFlags.

Add TbcPacketParsers::parseSpellStart and ::parseSpellGo using full GUIDs,
add virtual base methods, and route both handlers through virtual dispatch.
This commit is contained in:
Kelsi 2026-03-09 21:48:41 -07:00
parent 921c83df2e
commit 0a6f88e8ad
3 changed files with 83 additions and 2 deletions

View file

@ -12410,7 +12410,7 @@ static audio::SpellSoundManager::MagicSchool schoolMaskToMagicSchool(uint32_t ma
void GameHandler::handleSpellStart(network::Packet& packet) {
SpellStartData data;
if (!SpellStartParser::parse(packet, data)) return;
if (!packetParsers_->parseSpellStart(packet, data)) return;
// If this is the player's own cast, start cast bar
if (data.casterUnit == playerGuid && data.castTime > 0) {
@ -12435,7 +12435,7 @@ void GameHandler::handleSpellStart(network::Packet& packet) {
void GameHandler::handleSpellGo(network::Packet& packet) {
SpellGoData data;
if (!SpellGoParser::parse(packet, data)) return;
if (!packetParsers_->parseSpellGo(packet, data)) return;
// Cast completed
if (data.casterUnit == playerGuid) {