Core/Items: Fix an exploit where players would be able to reset the cooldown of items to the equip cooldown (30 seconds) when unequipping, equipping and then relogging.

This commit is contained in:
Discover-
2013-08-04 23:10:21 +02:00
parent 5164caa9ff
commit 4bb49378fc
@@ -22678,6 +22678,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);