diff options
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellHistory.cpp | 13 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellHistory.h | 6 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 69db8b9c1fa..9377640f724 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5372,7 +5372,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 return SPELL_FAILED_NOT_READY; } - if (m_caster->ToUnit() && !m_caster->ToUnit()->GetSpellHistory()->IsReady(m_spellInfo, m_castItemEntry, IsIgnoringCooldowns())) + if (!IsIgnoringCooldowns() && m_caster->ToUnit() && !m_caster->ToUnit()->GetSpellHistory()->IsReady(m_spellInfo, m_castItemEntry)) { if (m_triggeredByAuraSpell) return SPELL_FAILED_DONT_REPORT; diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 5c449789d41..95a9582063f 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -269,13 +269,13 @@ void SpellHistory::HandleCooldowns(SpellInfo const* spellInfo, uint32 itemId, Sp StartCooldown(spellInfo, itemId, spell); } -bool SpellHistory::IsReady(SpellInfo const* spellInfo, uint32 itemId /*= 0*/, bool ignoreCategoryCooldown /*= false*/) const +bool SpellHistory::IsReady(SpellInfo const* spellInfo, uint32 itemId /*= 0*/) const { if (spellInfo->PreventionType & SPELL_PREVENTION_TYPE_SILENCE) if (IsSchoolLocked(spellInfo->GetSchoolMask())) return false; - if (HasCooldown(spellInfo, itemId, ignoreCategoryCooldown)) + if (HasCooldown(spellInfo, itemId)) return false; if (!HasCharge(spellInfo->ChargeCategoryId)) @@ -660,14 +660,11 @@ void SpellHistory::ResetAllCooldowns() _spellCooldowns.clear(); } -bool SpellHistory::HasCooldown(SpellInfo const* spellInfo, uint32 itemId /*= 0*/, bool ignoreCategoryCooldown /*= false*/) const +bool SpellHistory::HasCooldown(SpellInfo const* spellInfo, uint32 itemId /*= 0*/) const { if (_spellCooldowns.count(spellInfo->Id) != 0) return true; - if (ignoreCategoryCooldown) - return false; - uint32 category = 0; GetCooldownDurations(spellInfo, itemId, nullptr, &category, nullptr); if (!category) @@ -676,9 +673,9 @@ bool SpellHistory::HasCooldown(SpellInfo const* spellInfo, uint32 itemId /*= 0*/ return _categoryCooldowns.count(category) != 0; } -bool SpellHistory::HasCooldown(uint32 spellId, uint32 itemId /*= 0*/, bool ignoreCategoryCooldown /*= false*/) const +bool SpellHistory::HasCooldown(uint32 spellId, uint32 itemId /*= 0*/) const { - return HasCooldown(sSpellMgr->AssertSpellInfo(spellId, _owner->GetMap()->GetDifficultyID()), itemId, ignoreCategoryCooldown); + return HasCooldown(sSpellMgr->AssertSpellInfo(spellId, _owner->GetMap()->GetDifficultyID()), itemId); } SpellHistory::Duration SpellHistory::GetRemainingCooldown(SpellInfo const* spellInfo) const diff --git a/src/server/game/Spells/SpellHistory.h b/src/server/game/Spells/SpellHistory.h index 2ec68b33cd6..a14c9c37a1b 100644 --- a/src/server/game/Spells/SpellHistory.h +++ b/src/server/game/Spells/SpellHistory.h @@ -87,7 +87,7 @@ public: void HandleCooldowns(SpellInfo const* spellInfo, Item const* item, Spell* spell = nullptr); void HandleCooldowns(SpellInfo const* spellInfo, uint32 itemId, Spell* spell = nullptr); - bool IsReady(SpellInfo const* spellInfo, uint32 itemId = 0, bool ignoreCategoryCooldown = false) const; + bool IsReady(SpellInfo const* spellInfo, uint32 itemId = 0) const; template<class PacketType> void WritePacket(PacketType* packet) const; @@ -129,8 +129,8 @@ public: } void ResetAllCooldowns(); - bool HasCooldown(SpellInfo const* spellInfo, uint32 itemId = 0, bool ignoreCategoryCooldown = false) const; - bool HasCooldown(uint32 spellId, uint32 itemId = 0, bool ignoreCategoryCooldown = false) const; + bool HasCooldown(SpellInfo const* spellInfo, uint32 itemId = 0) const; + bool HasCooldown(uint32 spellId, uint32 itemId = 0) const; Duration GetRemainingCooldown(SpellInfo const* spellInfo) const; Duration GetRemainingCategoryCooldown(uint32 categoryId) const; Duration GetRemainingCategoryCooldown(SpellInfo const* spellInfo) const; |
