mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Core/Pets: Fixed automatic resurrecting pets on battleground graveyards
Closes #25289
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user