Core/Pets: Fixed automatic resurrecting pets on battleground graveyards
Port From (https://github.com/TrinityCore/TrinityCore/commit/914791836318c62d8b206ef3cbffe144e63bf928)
This commit is contained in:
@@ -109,7 +109,7 @@ namespace Game.Entities
|
|||||||
return Tuple.Create(stable.StabledPets[stableSlot], PetSaveMode.FirstStableSlot + stableSlot);
|
return Tuple.Create(stable.StabledPets[stableSlot], PetSaveMode.FirstStableSlot + stableSlot);
|
||||||
|
|
||||||
foreach (var pet in stable.UnslottedPets)
|
foreach (var pet in stable.UnslottedPets)
|
||||||
if (pet.CreatureId == petEntry)
|
if (pet.PetNumber == petnumber)
|
||||||
return Tuple.Create(pet, PetSaveMode.NotInSlot);
|
return Tuple.Create(pet, PetSaveMode.NotInSlot);
|
||||||
}
|
}
|
||||||
else if (current)
|
else if (current)
|
||||||
@@ -280,6 +280,9 @@ namespace Game.Entities
|
|||||||
|
|
||||||
petStable.CurrentPet = unslottedPetInfo;
|
petStable.CurrentPet = unslottedPetInfo;
|
||||||
petStable.UnslottedPets.Remove(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
|
// Send fake summon spell cast - this is needed for correct cooldown application for spells
|
||||||
|
|||||||
@@ -2366,8 +2366,8 @@ namespace Scripts.Spells.Generic
|
|||||||
if (newPet.LoadPetFromDB(player, 0, player.GetLastPetNumber(), true))
|
if (newPet.LoadPetFromDB(player, 0, player.GetLastPetNumber(), true))
|
||||||
{
|
{
|
||||||
// revive the pet if it is dead
|
// revive the pet if it is dead
|
||||||
if (newPet.GetDeathState() == DeathState.Dead)
|
if (newPet.GetDeathState() != DeathState.Alive && newPet.GetDeathState() != DeathState.JustRespawned)
|
||||||
newPet.SetDeathState(DeathState.Alive);
|
newPet.SetDeathState(DeathState.JustRespawned);
|
||||||
|
|
||||||
newPet.SetFullHealth();
|
newPet.SetFullHealth();
|
||||||
newPet.SetFullPower(newPet.GetPowerType());
|
newPet.SetFullPower(newPet.GetPowerType());
|
||||||
|
|||||||
Reference in New Issue
Block a user