[7809] Replace repeating "remove cooldown and send update to client" code by function call.

This commit is contained in:
VladimirMangos 2009-05-09 19:27:52 +04:00
parent 09046df744
commit f117ce3420
6 changed files with 22 additions and 48 deletions

View file

@ -3214,6 +3214,20 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_
}
}
void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
{
m_spellCooldowns.erase(spell_id);
if(update)
{
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
data << uint32(spell_id);
data << uint64(GetGUID());
SendDirectMessage(&data);
}
}
void Player::RemoveArenaSpellCooldowns()
{
// remove cooldowns on spells that has < 15 min CD