Core/Pets: Updated pet summoning for latest client version (5 Call Pet spells and stable size 200)
Port From (https://github.com/TrinityCore/TrinityCore/commit/950db60435e7e513633ff5b22ad7f0ed8b1147e4)
This commit is contained in:
@@ -761,7 +761,9 @@ namespace Game.Entities
|
||||
{
|
||||
Player player = ToPlayer();
|
||||
PetStable petStable = player.GetOrInitPetStable();
|
||||
if (petStable.CurrentPet != null || petStable.GetUnslottedHunterPet() != null)
|
||||
|
||||
var freeActiveSlot = Array.FindIndex(petStable.ActivePets, petInfo => petInfo == null);
|
||||
if (freeActiveSlot == -1)
|
||||
return false;
|
||||
|
||||
pet.SetCreatorGUID(GetGUID());
|
||||
@@ -784,8 +786,11 @@ namespace Game.Entities
|
||||
pet.InitPetCreateSpells();
|
||||
pet.SetFullHealth();
|
||||
|
||||
petStable.CurrentPet = new();
|
||||
pet.FillPetInfo(petStable.CurrentPet);
|
||||
petStable.SetCurrentActivePetIndex((uint)freeActiveSlot);
|
||||
|
||||
PetStable.PetInfo petInfo = new();
|
||||
pet.FillPetInfo(petInfo);
|
||||
petStable.ActivePets[freeActiveSlot] = petInfo;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user