Fix pet spell cooldown being extended without successful cast
Closes #12560
This commit is contained in:
@@ -246,8 +246,6 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
me->SendUpdateToPlayer(owner->ToPlayer());
|
||||
}
|
||||
|
||||
me->AddCreatureSpellCooldown(spell->m_spellInfo->Id);
|
||||
|
||||
spell->prepare(&targets);
|
||||
}
|
||||
|
||||
|
||||
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user