mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-04 08:23:50 +00:00
fix: replace fragile heuristic in SMSG_INITIAL_SPELLS with explicit Classic format flag
Classic 1.12 uses uint16 spellId + uint16 slot (4 bytes/spell); TBC and WotLK use uint32 spellId + uint16 unknown (6 bytes/spell). The old size-based heuristic could misdetect TBC packets that happened to fit both layouts. Add a vanillaFormat parameter to InitialSpellsParser::parse and override parseInitialSpells in ClassicPacketParsers to always pass true, eliminating the ambiguity.
This commit is contained in:
parent
9d0da6242d
commit
ed48a3c425
3 changed files with 12 additions and 10 deletions
|
|
@ -1758,7 +1758,10 @@ struct InitialSpellsData {
|
|||
|
||||
class InitialSpellsParser {
|
||||
public:
|
||||
static bool parse(network::Packet& packet, InitialSpellsData& data);
|
||||
// vanillaFormat=true: Classic 1.12 uint16 spellId + uint16 slot (4 bytes/spell)
|
||||
// vanillaFormat=false: TBC/WotLK uint32 spellId + uint16 unk (6 bytes/spell)
|
||||
static bool parse(network::Packet& packet, InitialSpellsData& data,
|
||||
bool vanillaFormat = false);
|
||||
};
|
||||
|
||||
/** CMSG_CAST_SPELL packet builder */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue