mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
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.
This commit is contained in:
parent
2b131548aa
commit
dfe091473c
1 changed files with 13 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue