[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

@ -588,15 +588,7 @@ void Spell::FillTargetMap()
{
// clear cooldown at fail
if(m_caster->GetTypeId()==TYPEID_PLAYER)
{
((Player*)m_caster)->RemoveSpellCooldown(m_spellInfo->Id);
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
data << uint32(m_spellInfo->Id);
data << uint64(m_caster->GetGUID());
((Player*)m_caster)->GetSession()->SendPacket(&data);
}
((Player*)m_caster)->RemoveSpellCooldown(m_spellInfo->Id,true);
SendCastResult(SPELL_FAILED_NO_EDIBLE_CORPSES);
finish(false);
}