Core/Pets: Fixed crash happening when summoning a different pet than one that was unsummoned by summoning a guardian (imp -> infernal -> felhunter)
Closes #25478 (cherry picked from commit d29274f3a142545a386420e54f6169e4f7ed6eda)
This commit is contained in:
@@ -5820,8 +5820,8 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
if (oldPet != minion && (oldPet->IsPet() || minion->IsPet() || oldPet->GetEntry() != minion->GetEntry()))
|
||||
{
|
||||
// remove existing minion pet
|
||||
if (oldPet->IsPet())
|
||||
((Pet*)oldPet)->Remove(PET_SAVE_AS_CURRENT);
|
||||
if (Pet* oldPetAsPet = oldPet->ToPet())
|
||||
oldPetAsPet->Remove(PET_SAVE_NOT_IN_SLOT);
|
||||
else
|
||||
oldPet->UnSummon();
|
||||
SetPetGUID(minion->GetGUID());
|
||||
|
||||
Reference in New Issue
Block a user