From dfe091473c54e30e0c34df24d4bc2dc4fcc9d33f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 05:58:57 -0700 Subject: [PATCH] fix: show action bar cooldown timers for spells on cooldown at login SMSG_INITIAL_SPELLS delivers active cooldowns which were stored in spellCooldowns but never propagated to the action bar slot cooldownRemaining/cooldownTotal fields. This meant that spells with remaining cooldowns at login time showed no countdown overlay on the action bar. Sync the action bar slots from spellCooldowns after loadCharacterConfig() to restore the correct timers. --- src/game/game_handler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index a3f015cf..0b8846e6 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -16174,6 +16174,19 @@ void GameHandler::handleInitialSpells(network::Packet& packet) { actionBar[11].id = 8690; // Hearthstone loadCharacterConfig(); + // Sync login-time cooldowns into action bar slot overlays. Without this, spells + // that are still on cooldown when the player logs in show no cooldown timer on the + // action bar even though spellCooldowns has the right remaining time. + for (auto& slot : actionBar) { + if (slot.type == ActionBarSlot::SPELL && slot.id != 0) { + auto it = spellCooldowns.find(slot.id); + if (it != spellCooldowns.end() && it->second > 0.0f) { + slot.cooldownTotal = it->second; + slot.cooldownRemaining = it->second; + } + } + } + LOG_INFO("Learned ", knownSpells.size(), " spells"); }