Fix pet spell cooldown being extended without successful cast

Closes #12560
This commit is contained in:
MrSmite
2014-08-10 04:51:46 -04:00
parent 91053d557c
commit 5dcf111150
2 changed files with 7 additions and 2 deletions
-2
View File
@@ -246,8 +246,6 @@ void PetAI::UpdateAI(uint32 diff)
me->SendUpdateToPlayer(owner->ToPlayer());
}
me->AddCreatureSpellCooldown(spell->m_spellInfo->Id);
spell->prepare(&targets);
}
+7
View File
@@ -3420,7 +3420,14 @@ void Spell::SendSpellCooldown()
{
Player* _player = m_caster->ToPlayer();
if (!_player)
{
// Handle pet cooldowns here if needed instead of in PetAI to avoid hidden cooldown restarts
Creature* _creature = m_caster->ToCreature();
if (_creature && _creature->IsPet())
_creature->AddCreatureSpellCooldown(m_spellInfo->Id);
return;
}
// mana/health/etc potions, disabled by client (until combat out as declarate)
if (m_CastItem && (m_CastItem->IsPotion() || m_spellInfo->IsCooldownStartedOnEvent()))