Core/Players: Improve reset spell cooldowns when entering arenas (#30032)

Co-authored-by: Shauren <[email protected]>
(cherry picked from commit 97b19a54457d6239a8e57f61281bda1cd16b8984)
This commit is contained in:
Gildor
2024-12-08 18:42:57 +01:00
committed by Shauren
parent 4e89a302fc
commit 752ea0f8e9
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -3493,8 +3493,11 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr)
{
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first, DIFFICULTY_NONE);
return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
&& spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
SpellHistory::Duration cooldown = 0s;
SpellHistory::Duration categoryCooldown = 0s;
SpellHistory::GetCooldownDurations(spellInfo, itr->second.ItemId, &cooldown, nullptr, &categoryCooldown);
return cooldown < 10min
&& categoryCooldown < 10min
&& !spellInfo->HasAttribute(SPELL_ATTR6_DO_NOT_RESET_COOLDOWN_IN_ARENA);
}, true);
+2 -2
View File
@@ -178,6 +178,8 @@ public:
void PauseCooldowns();
void ResumeCooldowns();
static void GetCooldownDurations(SpellInfo const* spellInfo, uint32 itemId, Duration* cooldown, uint32* categoryId, Duration* categoryCooldown);
void SaveCooldownStateBeforeDuel();
void RestoreCooldownStateAfterDuel();
@@ -195,8 +197,6 @@ private:
void SendSetSpellCharges(uint32 chargeCategoryId, ChargeEntryCollection const& chargeCollection);
static void GetCooldownDurations(SpellInfo const* spellInfo, uint32 itemId, Duration* cooldown, uint32* categoryId, Duration* categoryCooldown);
Unit* _owner;
CooldownStorageType _spellCooldowns;
CooldownStorageType _spellCooldownsBeforeDuel;