Core/Spells: fix a crash.
This commit is contained in:
@@ -5464,7 +5464,8 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
|
||||
Unit* _target = m_targets.GetUnitTarget();
|
||||
|
||||
if (_target) //for target dead/target not valid
|
||||
// for target dead/target not valid
|
||||
if (_target)
|
||||
{
|
||||
if (!_target->isAlive())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
@@ -5472,8 +5473,10 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
if (!IsValidSingleTargetSpell(_target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
|
||||
// cooldown
|
||||
if (m_caster->ToCreature()->HasSpellCooldown(m_spellInfo->Id))
|
||||
if (Unit const* creatureCaster = m_caster->ToCreature())
|
||||
creatureCaster->HasSpellCooldown(m_spellInfo->Id))
|
||||
return SPELL_FAILED_NOT_READY;
|
||||
|
||||
return CheckCast(true);
|
||||
|
||||
Reference in New Issue
Block a user