mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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();
|
Unit* unitCaster = m_caster->ToUnit();
|
||||||
if (!unitCaster)
|
if (!unitCaster)
|
||||||
|
{
|
||||||
return SPELL_FAILED_BAD_TARGETS;
|
return SPELL_FAILED_BAD_TARGETS;
|
||||||
|
}
|
||||||
|
|
||||||
Creature* pet = unitCaster->GetGuardianPet();
|
Creature* pet = unitCaster->GetGuardianPet();
|
||||||
if (pet && pet->IsAlive())
|
if (pet)
|
||||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
{
|
||||||
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user