fix: include category cooldowns in initial spell cooldown tracking

SMSG_INITIAL_SPELLS cooldown entries have both cooldownMs (individual)
and categoryCooldownMs (shared, e.g. potions). The handler only checked
cooldownMs, so spells with category-only cooldowns (cooldownMs=0,
categoryCooldownMs=120000) were not tracked. Now uses the maximum of
both values, ensuring potion and similar shared cooldowns show on the
action bar after login.
This commit is contained in:
Kelsi 2026-03-20 07:02:57 -07:00
parent 533831e18d
commit 5172c07e15

View file

@ -18753,10 +18753,12 @@ void GameHandler::handleInitialSpells(network::Packet& packet) {
knownSpells.insert(6603u);
knownSpells.insert(8690u);
// Set initial cooldowns
// Set initial cooldowns — use the longer of individual vs category cooldown.
// Spells like potions have cooldownMs=0 but categoryCooldownMs=120000.
for (const auto& cd : data.cooldowns) {
if (cd.cooldownMs > 0) {
spellCooldowns[cd.spellId] = cd.cooldownMs / 1000.0f;
uint32_t effectiveMs = std::max(cd.cooldownMs, cd.categoryCooldownMs);
if (effectiveMs > 0) {
spellCooldowns[cd.spellId] = effectiveMs / 1000.0f;
}
}