Core/Pets: Fixed automatic resurrecting pets on battleground graveyards

Port From (https://github.com/TrinityCore/TrinityCore/commit/914791836318c62d8b206ef3cbffe144e63bf928)
This commit is contained in:
hondacrx
2022-03-10 09:45:48 -05:00
parent 4a97585ee9
commit 9b2e317c44
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -109,7 +109,7 @@ namespace Game.Entities
return Tuple.Create(stable.StabledPets[stableSlot], PetSaveMode.FirstStableSlot + stableSlot);
foreach (var pet in stable.UnslottedPets)
if (pet.CreatureId == petEntry)
if (pet.PetNumber == petnumber)
return Tuple.Create(pet, PetSaveMode.NotInSlot);
}
else if (current)
@@ -280,6 +280,9 @@ namespace Game.Entities
petStable.CurrentPet = unslottedPetInfo;
petStable.UnslottedPets.Remove(unslottedPetInfo);
// old petInfo is no longer valid, refresh it
petInfo = petStable.CurrentPet;
}
// Send fake summon spell cast - this is needed for correct cooldown application for spells
+2 -2
View File
@@ -2366,8 +2366,8 @@ namespace Scripts.Spells.Generic
if (newPet.LoadPetFromDB(player, 0, player.GetLastPetNumber(), true))
{
// revive the pet if it is dead
if (newPet.GetDeathState() == DeathState.Dead)
newPet.SetDeathState(DeathState.Alive);
if (newPet.GetDeathState() != DeathState.Alive && newPet.GetDeathState() != DeathState.JustRespawned)
newPet.SetDeathState(DeathState.JustRespawned);
newPet.SetFullHealth();
newPet.SetFullPower(newPet.GetPowerType());