fix(Core/Spells): Revive Pet cannot be cast if there is not pet to resurrect (#12818)
- Closes #12776
This commit is contained in:
parent
d40e3340fb
commit
2ef8d2e1e2
1 changed files with 17 additions and 2 deletions
|
|
@ -6336,11 +6336,26 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
{
|
||||
Unit* unitCaster = m_caster->ToUnit();
|
||||
if (!unitCaster)
|
||||
{
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
|
||||
Creature* pet = unitCaster->GetGuardianPet();
|
||||
if (pet && pet->IsAlive())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
if (pet)
|
||||
{
|
||||
if (pet->IsAlive())
|
||||
{
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
}
|
||||
}
|
||||
else if (Player* playerCaster = m_caster->ToPlayer())
|
||||
{
|
||||
PetStable& petStable = playerCaster->GetOrInitPetStable();
|
||||
if (!petStable.CurrentPet && petStable.UnslottedPets.empty())
|
||||
{
|
||||
return SPELL_FAILED_NO_PET;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue