Merge pull request #10445 from Discover-/Cooldown-Exploit

Core/Items: Fix an exploit where players would be able to reset the cool...
This commit is contained in:
Nay
2013-08-06 08:35:57 -07:00
@@ -22684,6 +22684,11 @@ void Player::ApplyEquipCooldown(Item* pItem)
if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
continue;
//! Don't replace longer cooldowns by equip cooldown if we have any.
SpellCooldowns::iterator itr = m_spellCooldowns.find(spellData.SpellId);
if (itr != m_spellCooldowns.end() && itr->second.itemid == pItem->GetEntry() && itr->second.end > time(NULL) + 30)
break;
AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30);
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);