Core/Pets: Fixed crash happening when summoning a different pet than one that was unsummoned by summoning a guardian (imp -> infernal -> felhunter)
Port From (https://github.com/TrinityCore/TrinityCore/commit/e102022eeb8a0fd402e34de92468b2afb8f1f006)
This commit is contained in:
@@ -127,8 +127,9 @@ namespace Game.Entities
|
|||||||
if (oldPet != minion && (oldPet.IsPet() || minion.IsPet() || oldPet.GetEntry() != minion.GetEntry()))
|
if (oldPet != minion && (oldPet.IsPet() || minion.IsPet() || oldPet.GetEntry() != minion.GetEntry()))
|
||||||
{
|
{
|
||||||
// remove existing minion pet
|
// remove existing minion pet
|
||||||
if (oldPet.IsPet())
|
Pet oldPetAsPet = oldPet.ToPet();
|
||||||
((Pet)oldPet).Remove(PetSaveMode.AsCurrent);
|
if (oldPetAsPet != null)
|
||||||
|
oldPetAsPet.Remove(PetSaveMode.NotInSlot);
|
||||||
else
|
else
|
||||||
oldPet.UnSummon();
|
oldPet.UnSummon();
|
||||||
SetPetGUID(minion.GetGUID());
|
SetPetGUID(minion.GetGUID());
|
||||||
|
|||||||
Reference in New Issue
Block a user