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 | |
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')
-rw-r--r-- | src/server/scripts/Spells/spell_dh.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/World/duel_reset.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp index 986d75fd313..eb91f1d1a46 100644 --- a/src/server/scripts/Spells/spell_dh.cpp +++ b/src/server/scripts/Spells/spell_dh.cpp @@ -391,9 +391,9 @@ class spell_dh_chaotic_transformation : public SpellScript void HandleCooldown() const { - GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) + GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownEntry const& cooldown) { - uint32 category = sSpellMgr->AssertSpellInfo(itr->first, DIFFICULTY_NONE)->CategoryId; + uint32 category = sSpellMgr->AssertSpellInfo(cooldown.SpellId, DIFFICULTY_NONE)->CategoryId; return category == SPELL_CATEGORY_DH_EYE_BEAM || category == SPELL_CATEGORY_DH_BLADE_DANCE; }, true); } 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 |