Core/Spells: You should be able to revive pets from anywhere without summoning them first

Closes #1090
Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
Subv
2012-04-08 16:22:19 -05:00
parent 268401029e
commit 38d5fbac0e
2 changed files with 11 additions and 6 deletions

View File

@@ -5238,10 +5238,8 @@ SpellCastResult Spell::CheckCast(bool strict)
case SPELL_EFFECT_SUMMON_DEAD_PET:
{
Creature* pet = m_caster->GetGuardianPet();
if (!pet)
return SPELL_FAILED_NO_PET;
if (pet->isAlive())
if (pet && pet->isAlive())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
break;
@@ -5291,7 +5289,6 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->GetCharmGUID())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
break;
}
case SPELL_EFFECT_SUMMON_PLAYER:

View File

@@ -5726,7 +5726,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
return;
Pet* pet = player->GetPet();
if (!pet || pet->isAlive())
if (pet && pet->isAlive())
return;
if (damage < 0)
@@ -5734,8 +5734,16 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
float x, y, z;
player->GetPosition(x, y, z);
if (!pet)
{
player->SummonPet(0, x, y, z, player->GetOrientation(), SUMMON_PET, 0);
pet = player->GetPet();
}
if (!pet)
return;
player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation());
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);