Core/Pets: Fixed automatic resurrecting pets on battleground graveyards

Closes #25289
This commit is contained in:
Shauren
2020-08-20 18:44:36 +02:00
parent fc32c3fd3b
commit 74a0d579ee
2 changed files with 3 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ std::pair<PetStable::PetInfo const*, PetSaveMode> Pet::GetLoadPetInfo(PetStable
return { &stable.StabledPets[stableSlot].value(), PetSaveMode(PET_SAVE_FIRST_STABLE_SLOT + stableSlot) };
for (PetStable::PetInfo const& pet : stable.UnslottedPets)
if (pet.CreatureId == petEntry)
if (pet.PetNumber == petnumber)
return { &pet, PET_SAVE_NOT_IN_SLOT };
}
else if (current)

View File

@@ -2744,8 +2744,8 @@ class spell_gen_pet_summoned : public SpellScript
if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
{
// revive the pet if it is dead
if (newPet->getDeathState() == DEAD)
newPet->setDeathState(ALIVE);
if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
newPet->setDeathState(JUST_RESPAWNED);
newPet->SetFullHealth();
newPet->SetPower(newPet->GetPowerType(), newPet->GetMaxPower(newPet->GetPowerType()));