mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7809] Replace repeating "remove cooldown and send update to client" code by function call.
This commit is contained in:
parent
09046df744
commit
f117ce3420
6 changed files with 22 additions and 48 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue