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.
This commit is contained in:
Kelsi 2026-03-20 07:28:24 -07:00
parent f101ed7c83
commit eeb116ff7e

View file

@ -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");