Core/Pets: Pet management refactoring

Port From (https://github.com/TrinityCore/TrinityCore/commit/ca92686b44cc8c53a8991bf02d6e8534797fc115)
This commit is contained in:
hondacrx
2022-03-10 09:39:55 -05:00
parent 9d5dd66215
commit 718302fa18
14 changed files with 549 additions and 378 deletions
+2 -2
View File
@@ -2293,14 +2293,14 @@ namespace Game.Spells
}
if (owner.IsTypeId(TypeId.Player))
owner.ToPlayer().RemovePet(OldSummon, (OldSummon.GetPetType() == PetType.Hunter ? PetSaveMode.AsDeleted : PetSaveMode.NotInSlot), false);
owner.ToPlayer().RemovePet(OldSummon, PetSaveMode.NotInSlot, false);
else
return;
}
float x, y, z;
owner.GetClosePoint(out x, out y, out z, owner.GetCombatReach());
Pet pet = owner.SummonPet(petentry, x, y, z, owner.Orientation, PetType.Summon, 0, true);
Pet pet = owner.SummonPet(petentry, x, y, z, owner.Orientation, PetType.Summon, 0);
if (!pet)
return;