From eeb116ff7ed7ad2c409220cd22d07b0704ff3bd8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 07:28:24 -0700 Subject: [PATCH] fix: raise initial spell count cap from 256 to 1024 WotLK characters with all ability ranks, mounts, companion pets, professions, and racial skills can know 400-600 spells. The previous 256 cap truncated the spell list, causing missing spells in the spellbook, broken /cast commands for truncated spells, and missing cooldown tracking for spells beyond the cap. --- src/game/world_packets.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index e20c2d09..13738332 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -3635,8 +3635,10 @@ bool InitialSpellsParser::parse(network::Packet& packet, InitialSpellsData& data data.talentSpec = packet.readUInt8(); uint16_t spellCount = packet.readUInt16(); - // Cap spell count to prevent excessive iteration - constexpr uint16_t kMaxSpells = 256; + // Cap spell count to prevent excessive iteration. + // WotLK characters with all ranks, mounts, professions, and racials can + // know 400-600 spells; 1024 covers all practical cases with headroom. + constexpr uint16_t kMaxSpells = 1024; if (spellCount > kMaxSpells) { LOG_WARNING("SMSG_INITIAL_SPELLS: spellCount=", spellCount, " exceeds max ", kMaxSpells, ", capping");