diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-01-30 18:27:38 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-01-30 18:27:38 +0100 |
commit | ace6342aea9e8e3f69af88ca3963fc961ba56f1b (patch) | |
tree | b8f7395f5580cabc4a1b661135f88145457107ac /src/server/scripts/World | |
parent | 304a25a91d3e9cdad1cc4682cfe540d51c43a15d (diff) |
Core/Spells: Refactor SpellHistory ModifyCoooldowns and ResetCooldowns callbacks to use CooldownEntry argument instead of internal iterator
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r-- | src/server/scripts/World/duel_reset.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/scripts/World/duel_reset.cpp b/src/server/scripts/World/duel_reset.cpp index 9f4fc5977c9..6d3dca3d16f 100644 --- a/src/server/scripts/World/duel_reset.cpp +++ b/src/server/scripts/World/duel_reset.cpp @@ -91,9 +91,9 @@ class DuelResetScript : public PlayerScript static void ResetSpellCooldowns(Player* player, bool onStartDuel) { // remove cooldowns on spells that have < 10 min CD > 30 sec and has no onHold - player->GetSpellHistory()->ResetCooldowns([player, onStartDuel](SpellHistory::CooldownStorageType::iterator itr) -> bool + player->GetSpellHistory()->ResetCooldowns([player, onStartDuel](SpellHistory::CooldownEntry const& cooldown) -> bool { - SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first, DIFFICULTY_NONE); + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(cooldown.SpellId, DIFFICULTY_NONE); Milliseconds remainingCooldown = player->GetSpellHistory()->GetRemainingCooldown(spellInfo); Milliseconds totalCooldown = Milliseconds(spellInfo->RecoveryTime); Milliseconds categoryCooldown = Milliseconds(spellInfo->CategoryRecoveryTime); @@ -114,7 +114,7 @@ class DuelResetScript : public PlayerScript applySpellMod(categoryCooldown); return remainingCooldown > 0ms - && !itr->second.OnHold + && !cooldown.OnHold && Milliseconds(totalCooldown) < 10min && Milliseconds(categoryCooldown) < 10min && Milliseconds(remainingCooldown) < 10min |