mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
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:
parent
533831e18d
commit
5172c07e15
1 changed files with 5 additions and 3 deletions
|
|
@ -18753,10 +18753,12 @@ void GameHandler::handleInitialSpells(network::Packet& packet) {
|
||||||
knownSpells.insert(6603u);
|
knownSpells.insert(6603u);
|
||||||
knownSpells.insert(8690u);
|
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) {
|
for (const auto& cd : data.cooldowns) {
|
||||||
if (cd.cooldownMs > 0) {
|
uint32_t effectiveMs = std::max(cd.cooldownMs, cd.categoryCooldownMs);
|
||||||
spellCooldowns[cd.spellId] = cd.cooldownMs / 1000.0f;
|
if (effectiveMs > 0) {
|
||||||
|
spellCooldowns[cd.spellId] = effectiveMs / 1000.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue