mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core/Spells): Revive Pet cannot be cast if there is not pet to resurrect (#12818)
- Closes #12776
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user